Re: [R] how to referee a dimension name via a variable?

2011-08-29 Thread Duncan Murdoch
On 29/08/2011 3:52 PM, Jie TANG wrote: thank you , it works . another problem is if can could define a variable to express the data.frame? for example : datanam<-c("newdata","newdata2") plot(datanam[1][[newnam[1]]]) Use get(): plot(get(datanam[1])[[newnam[1]]])) Duncan Murdoch 2011/8/30 J

Re: [R] how to referee a dimension name via a variable?

2011-08-29 Thread Jie TANG
thank you , it works . another problem is if can could define a variable to express the data.frame? for example : datanam<-c("newdata","newdata2") plot(datanam[1][[newnam[1]]]) 2011/8/30 Justin Haynes > try: > > newnam<-paste('newdatadat',dayno,sep='') > > plot(test[[newnam[1]]]) > > > On Mon,

Re: [R] how to referee a dimension name via a variable?

2011-08-29 Thread Justin Haynes
try: newnam<-paste('newdatadat',dayno,sep='') plot(test[[newnam[1]]]) On Mon, Aug 29, 2011 at 12:29 PM, Jie TANG wrote: > hi, R-users > I have a data.frame for example test$newdataday24 and test$newdataday48 > I can plot them by > plot(test$newdataday24) > but now i want to plot different

[R] how to referee a dimension name via a variable?

2011-08-29 Thread Jie TANG
hi, R-users I have a data.frame for example test$newdataday24 and test$newdataday48 I can plot them by plot(test$newdataday24) but now i want to plot different data by define a variable to describe them dayno<-c(24,48) newnam<-paste("test$newdataday",dayno,sep="") plot(newnam[1]) but i failed,