[R] Performance of concatenating strings

jim holtman jholtman at gmail.com
Wed Oct 31 14:24:52 CET 2007


How often are you doing it?  How large are your strings?  What exactly
are you  doing with them?  Have you considered keeping them in a list
and then using 'do.call' to do the concatenation all at once?  Have
you used Rprof on your program to see where time is being spent? How
much memory, and OS, do you have?  How 'fast' is 'fast'?  What is your
current performance and what are your goals?

You have not supplied sufficient information; you need to do some more
homework and provide some actual data.



On 10/31/07, Tamara Steijger <smara1 at gmx.de> wrote:
> Hi,
>
> I would like to ask how the paste(S1, S2, sep="") function internally
> works. Are the two stings copied to a new String?
>
> I have a program where successively strings are build up. First the
> program calls an external function and depending on the result it
> builds up strings to visualize the result. The external function is
> really fast, also for huge input data. But the building of the
> strings takes much to long for huge input sizes. So I'm wondering if
> the concatenating could be the problem, like using String in Java
> instead of StringBuffer. Is there something like StringBuffers in R
> also?
>
> Thanks,
> T. Steijger
>
> ______________________________________________
> 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 you are trying to solve?



More information about the R-help mailing list