<div dir="ltr">Thiago,<div>você pode utilizar a função gsub.</div><div><br></div><div><div><br></div><div>i <- c("./maize-yield.csv", "./rice-yield.csv", "./soybean-yield.csv", "./sugarcane-yield.csv", "./wheat-yield.csv")</div>
<div>gsub("^(./)(.*)(-.*)$","\\2", i, fixed=F)</div></div><div><br></div><div><span class="" style="border-collapse:separate;color:rgb(0,0,0);font-family:'Ubuntu Mono';font-size:14px;line-height:16px;white-space:pre-wrap;border-spacing:0px;background-color:rgb(225,226,229)"><pre tabindex="0" class="" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important">
[1] "maize"     "rice"      "soybean"   "sugarcane" "wheat"    </pre><pre tabindex="0" class="" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important">
<br></pre><pre tabindex="0" class="" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important">Abraços,</pre>
<pre tabindex="0" class="" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important">Paulo Nogueira Starzynski</pre>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/22 Thiago V. dos Santos <span dir="ltr"><<a href="mailto:thi_veloso@yahoo.com.br" target="_blank">thi_veloso@yahoo.com.br</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">
<span>Olá pessoal,</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span>Digamos que eu tenha uma lista com os nomes de vários arquivos:</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span><br></span></div><div style="background-color:transparent">i <- c("./maize-yield.csv", "./rice-yield.csv",
 "./soybean-yield.csv", "./sugarcane-yield.csv", "./wheat-yield.csv")<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span style="font-size:12pt">e eu precise extrair os caracteres após a barra ("/") e antes do hífen ("-") , ou seja, o nome das culturas.</span><br>
</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span style="font-size:12pt"><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span style="font-size:12pt">Qual comando ou combinação de comandos eu devo usar para chegar ao seguinte resultado?</span></div><div style="font-style:normal;font-size:12pt;background-color:transparent;font-family:'times new roman','new york',times,serif">
<span style="font-size:12pt"><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span style="font-size:12pt">> ii</span></div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif"><span style="font-size:12pt">[1] "maize" "rice" "soybean" "sugarcane" "wheat"</span></div>
<div style="font-family:'times new roman','new york',times,serif;font-size:12pt"><br></div><div style="font-family:'times new roman','new york',times,serif;font-size:12pt">Agradece desde já,<br>
--<br>Thiago V. dos Santos<br>PhD student<br>Land and Atmospheric Science<br>University of Minnesota<br><a href="http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm" target="_blank">http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm</a><br>
Phone: <a href="tel:%28612%29%20323%209898" value="+16123239898" target="_blank">(612) 323 9898</a></div></div></div><br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br></div>