Try this: for(i in 1:100)assign(sprintf("id.%d", i), value = sample(1)) id <- ls(patt = "id.[0-9]")
On Wed, Jun 4, 2008 at 7:52 PM, Manli Yan <[EMAIL PROTECTED]> wrote: > I need to create 100 variable ,whose name is id.1,id.2~~~~id.100 > then I need to let a vector say id<-c(id.1,id.2....id.100) > any easy way to do this? > thanks a lot~ > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@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.