[R] Performance of concatenating strings

Tamara Steijger smara1 at gmx.de
Wed Oct 31 12:50:37 CET 2007


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



More information about the R-help mailing list