[R] Help with paste()

Charilaos Skiadas skiadas at hanover.edu
Sat Mar 3 20:44:49 CET 2007


On Mar 3, 2007, at 2:29 PM, Michael Kubovy wrote:

> Dear r-helpers,
>
> Could you please tell me what's missing:
> rbind(paste('txt.est',1:24, sep = ''))
> txt.est1, ... txt.est24 are vectors that I wish to rbind.

the paste call just returns a vector of the strings "txt.est1" and so  
on. Then you tell it to rbind this vector with nothing else.

You might want to try something like this, though I hope someone else  
comes with a better solution:

cmd <- paste("rbind(",paste('txt.est',1:24, sep = '',collapse=", "),  
")", sep="")
eval(parse(text=cmd))


Haris Skiadas
Department of Mathematics and Computer Science
Hanover College



More information about the R-help mailing list