[R] gsub with regular expression

Sebastian Kruk residuo.solow at gmail.com
Fri Jun 25 16:48:06 CEST 2010


If I have a text with 7 words per line and I would like to put first
and second word joined in a vector and the rest of words one per
column in a matrix how can I do it?

First 2 lines of my text file:
"2008/12/31 12:23:31 numero 343.233.233 Rodeo Vaca Ruido"
"2010/02/01 02:35:31 palabra 111.111.222 abejorro Rodeo Vaca"

Results:

Vector:
2008/12/31 12:23:31
2010/02/01 02:35:31

Matrix
"numero" 343.233.233 "Rodeo"   "Vaca"   "Ruido"
"palabra" 111.111.222 "abejorro" "Rodeo" "Vaca"

Thks,

Sebastian.



More information about the R-help mailing list