Maybe you want something like this. temp<-data.frame(id=rbinom(10,5,.5),grp=rbinom(10,3,.3),stdid=rnorm(10)) kk<-"stdid" temp[,kk]
-tgs On Tue, Apr 20, 2010 at 7:32 AM, venkata kirankumar <kiran4u2...@gmail.com>wrote: > Hi all, > I have a problem with retreaving column from a data.frame that is > > I have a data.frame named "temp" > in that dataframe some column are there whose names are > > "IDENTIFIER" "UNIQUEID" "TRIALGROUPSID" "GRPNUMBER" > "GRPDESC" "SEXDID" "STDID" "STUDYTYPE" > "SDID" "DOSDID" "SOPDID" "SPECIES" > > i can retreave any column with using command like "temp$STDID" > > but my problem is the column name i have to get from another xml its > comming like "STDID" > that one i assigned to a variable named "kk" like kk<-"STDID" > > but now while i am trying to retreave this column from dataframe temp > like temp$kk or > with using command paste like > > paste("temp",kk,sep"$") > both the times its giving null result > but its having values in table > > can any one help me how to get column values from dataframe like these > cases > > thanks in advance > kiran > > [[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. > [[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.