<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Bom dia senhores!!</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Suponha que eu tenha o seguinte vetor:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>vet <- paste(seq(1:12),1:5,sep='.')<br> <br>Eu terei
sempre um 'ponto' e um número a direita de cada elemento do vetor. O meu objetivo, é pegar exatamente qualquer<br>coisa que esteja à esquerda deste ponto. Então fiz:<br><br>unlist(lapply(strsplit(vet,split='[[:punct:]][[:alnum:]]'),function(x)sample(x[1]))) <br> <br></span></div><div>Tem algum modo mais inteligente?<br><br>Desde já, grato! <br></div><div style="background-color:transparent;" align="center"><font style="background-color:transparent;" face="comic sans ms" size="2"><font size="1"><b><br></b></font></font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace, sans-serif" size="2">\begin{signature}</font></font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace,
sans-serif" size="2"><<>>=</font></font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Prof. Dr. Ivan Bezerra Allaman</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Universidade Estadual de Santa Cruz</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Departamento de Ciências Exatas e Tecnológicas</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Ilhéus/BA - Brasil</font></div><div style="text-align:left;background-color:transparent;" align="center"><font
class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">Fone: +55 73 3680-5596</font></div><div style="text-align:left;background-color:transparent;" align="center"><font class="Apple-style-span" face="courier, monaco, monospace, sans-serif" size="2">E-mail: ivanalaman@yahoo.com.br/ivanalaman@gmail.com</font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace, sans-serif" size="2">@</font></font></div><div style="text-align:left;background-color:transparent;" align="center"><font style="background-color:transparent;"><font face="courier, monaco, monospace, sans-serif" size="2">\end{signature}</font></font></div></div></body></html>