[R] function similar to "get" that works for both an object, and elements of an object?

From: new ruser <newruser_at_yahoo.com>
Date: Sat, 12 May 2007 09:05:25 -0700 (PDT)


#Is there a single function similar to "get" that works for both an object, and elements of an object ?
#(I want the function to be able to return objects, and/or the deeper elements of an object.)

#(i.e. elements of a dataframe and/or list)?

#e.g.

tempdf = data.frame(a=c(4,5,6) , b=c(10,11,12) )

templist= list(x=tempdf, y=c(1,2))

get('tempdf') #works as desired

get('tempdf$a') #retrusn errro message

get('templist$x') #retrusn errro message  



8:00? 8:25? 8:40? Find a flick in no time

        [[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 and provide commented, minimal, self-contained, reproducible code. Received on Sat 12 May 2007 - 16:10:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 12 May 2007 - 17:31:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.