Hi,
You can leverage read.table using a textConnection:
txt - x,y,z,a,b,c,dda,b,c,d,e,f,gd
con - textConnection( gsub( d, \\\n, txt ) )
read.table( con, sep = , )
V1 V2 V3 V4 V5 V6 V7
1 x y z a b c d
2 a b c d e f g
close( con )
Romain
Le 10/09/10 06:41, rajesh j a écrit :
Hi,
I perform the operations unlist,strsplit,gsub and the for loop on a lot of
strings and its heavily slowing down the overall system. Is there some way
for me to speeden up these operations..maybe like alternate versions that
exist which use multiprocessors etc.
--
Rajesh.J
First thing to do is to use Rprof to profile your code to see where
the time is being spent, then you can make a decision as to what to
change. Are you carrying out the operations on a dataframe, if so can
you change it to a matrix for some of the operations? You have
provided no idea of what
Ok. These operations are on a string and the result is added to a
data.frame.
I have strings of the form
x,y,z,a,b,c,dda,b,c,d,e,f,gd
essentially comma separated values delimited by a d
I first do a
unlist(strsplit(string,split=d))
and then a
strsplit(string,split=,)
The list of vectors i end up
4 matches
Mail list logo