[R] list of data frame objects

2007-02-18 Thread Tim McDonald
Hi Folks,

I need to extract the list of all my data frame objects. With   objects() I can 
list all objects and was hoping to use something like the following:

objects()[is.data.frame(objects())] to extracts all my objects that are data 
frame...

What am I doing wrong?

Thanks - Tim 

 
-
Any questions?  Get answers on any topic at Yahoo! Answers. Try it now.
[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] list of data frame objects

2007-02-18 Thread Dimitris Rizopoulos
try something like the following (untested):

objs - ls()
sapply(objs, function(obj) inherits(get(obj), data.frame))


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
  http://www.student.kuleuven.be/~m0390867/dimitris.htm


Quoting Tim McDonald [EMAIL PROTECTED]:

 Hi Folks,

 I need to extract the list of all my data frame objects. With 
 objects() I can list all objects and was hoping to use something   
 like the following:

 objects()[is.data.frame(objects())] to extracts all my objects that   
 are data frame...

 What am I doing wrong?

 Thanks - Tim


 -
 Any questions?  Get answers on any topic at Yahoo! Answers. Try it now.
   [[alternative HTML version deleted]]

 __
 R-help@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.





Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
R-help@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.