[R] merge words=data name

Robert McFadden robert-mcfadden at o2.pl
Sun Feb 11 21:39:12 CET 2007


I would like to merge two parts of words to get a name of the data. First
M3$N (invariable) and second is a number from 0001 to 3003 -
M3$N0001,M3$N0002,...,M3$N3003. For example if I do it like this:
my.data <- paste("M3$N",2456,sep="")
I get
> my.data
[1] "M3$N2456"
But I want to get something equivalent to
my.data<- M3$N2456

Is there any way to do it? 
It's important, because the second part are randomly chosen.
(The data that I would like to extract are in package Mcomp.)  

Thanks in advance,
Rob



More information about the R-help mailing list