Hi everybody, I have a lable vector , raw.labs= paste("file1", 1:20, sep = "") And i can i make the content of raw.labs to be a object name. eg ,file1=123(use some function on raw.labs to generate the name file1) Thanks! [[alternative HTML version deleted]]
What about assign? assign(raw.labs[1],123) maybe you're thinking about something like this (raw.values = vector of values) for(i in 1:length(raw.labs)) assign(raw.labs[i],raw.values[i]) Not elegant but works Stefano On Fri, May 13, 2005 at 11:24:24PM +0800, Xiao Shi wrote: <Xiao>Hi everybody, <Xiao>I have a lable vector , <Xiao>raw.labs= paste("file1", 1:20, sep = "") <Xiao>And i can i make the content of raw.labs to be a object name. <Xiao>eg ,file1=123(use some function on raw.labs to generate the name file1) <Xiao>Thanks! <Xiao> <Xiao> [[alternative HTML version deleted]] <Xiao> <Xiao>______________________________________________ <Xiao>R-help at stat.math.ethz.ch mailing list <Xiao>https://stat.ethz.ch/mailman/listinfo/r-help <Xiao>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
The obvious way is to use assign(). The possibly better way is to store the objects in a list. Andy> From: Xiao Shi > > Hi everybody, > I have a lable vector , > raw.labs= paste("file1", 1:20, sep = "") > And i can i make the content of raw.labs to be a object name. > eg ,file1=123(use some function on raw.labs to generate the > name file1) > Thanks! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > > >
Seemingly Similar Threads
- how to get such a subset of a matrix?
- How to plot a matrix with 18 rows by row vs. a vector in a single graph, resulting 18 lines with different colors?
- Value lables, variable lables
- [LLVMdev] Compile units in debugging intrinsics / globals
- How to get the remaining vector after sampling a subset?