Thomas Lumley wrote:

paste(rep(" ",n), collapse="")

gives a string of n spaces.


Is that more or less efficient/faster or slower than using sprintf:


sprintf(paste("%",n,"s",sep='')," ")

A quick test shows it to take about two-thirds the CPU time of the paste(rep()) solution.

Not that it matters - I cant see something like this ever being a significant part of any calculation!

Baz

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to