[R] faster unlist,strsplit,gsub,for

jim holtman jholtman at gmail.com
Fri Sep 10 05:44:02 CEST 2010


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 your code or data looks like, or how often
each of the operations is being done.

There are probably many ways of speeding up the code, but with no idea
of what the code is, no solutions can be specified.

On Thu, Sep 9, 2010 at 11:09 PM, rajesh j <akshay.rajesh at gmail.com> wrote:
> 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
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list