Re: [R] ls() and classes

2008-03-19 Thread Henrik Bengtsson
> library(R.oo) > example(data.frame) > example(matrix) > example(iris) > ll() member data.class dimension objectSize 1 author character 1120 2 d data.frame c(10,3) 1136 3 d.0 data.framec(0,3)824 4 d0 data.frame c(10,0)320 5 d00

Re: [R] ls() and classes

2008-03-19 Thread David Winsemius
Rolf Turner <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > On 19/03/2008, at 4:39 PM, Erin Hodgess wrote: > >> Dear R People: >> >> I want to get the class of all of the objects in my directory. >> > > Too easy!!! > > sapply(ls(),function(x){class(get(x))}) > Thank you, Rolf. Th

Re: [R] ls() and classes

2008-03-19 Thread Martin Maechler
> "GaGr" == Gabor Grothendieck <[EMAIL PROTECTED]> > on Tue, 18 Mar 2008 23:50:28 -0400 writes: GaGr> Try: GaGr> eapply(.GlobalEnv, class) GaGr> or perhaps GaGr> unlist(eapply(.GlobalEnv, class)) GaGr> or GaGr> str(eapply(.GlobalEnv, class)) nice! {and we'

Re: [R] ls() and classes

2008-03-18 Thread Richard M. Heiberger
Correction to my thinko sapply(ls(), function(x) class(get(x))) __ 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

Re: [R] ls() and classes

2008-03-18 Thread Benilton Carvalho
On Mar 18, 2008, at 11:44 PM, Rolf Turner wrote: On 19/03/2008, at 4:39 PM, Erin Hodgess wrote: do.call(class,list=ls()) sapply(ls(),function(x){class(get(x))}) or, in case you want to save some typing: eapply(globalenv(), class) b__ R-help@r-

Re: [R] ls() and classes

2008-03-18 Thread Gabor Grothendieck
Try: eapply(.GlobalEnv, class) or perhaps unlist(eapply(.GlobalEnv, class)) or str(eapply(.GlobalEnv, class)) On Tue, Mar 18, 2008 at 11:39 PM, Erin Hodgess <[EMAIL PROTECTED]> wrote: > Dear R People: > > I want to get the class of all of the objects in my directory. > > I was trying: > > do

Re: [R] ls() and classes

2008-03-18 Thread Richard M. Heiberger
sapply(ls(), class) __ 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.

Re: [R] ls() and classes

2008-03-18 Thread Rolf Turner
On 19/03/2008, at 4:39 PM, Erin Hodgess wrote: > Dear R People: > > I want to get the class of all of the objects in my directory. > > I was trying: > > do.call(class,list=ls()) > > but got an "unused argument error". > > I'm sure it's simple, but I'm just not seeing it. > > Any help would be muc

[R] ls() and classes

2008-03-18 Thread Erin Hodgess
Dear R People: I want to get the class of all of the objects in my directory. I was trying: do.call(class,list=ls()) but got an "unused argument error". I'm sure it's simple, but I'm just not seeing it. Any help would be much appreciated. Sincerely, Erin -- Erin Hodgess Associate Professo