Re: [R] ls() and classes

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Wed, 19 Mar 2008 11:49:45 +0100

>>>>> "GaGr" == Gabor Grothendieck <ggrothendieck_at_gmail.com> >>>>> 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've also seen the slightly higher-level

         'globalenv()' instead of '.GlobalEnv' }

Not really answering Erin's question, I'd like to mention

  ls.str()

which had been created in the distant past to be used possibly in a similar situation to where Erin wanted to get each class.

Martin

    GaGr> On Tue, Mar 18, 2008 at 11:39 PM, Erin Hodgess <erinm.hodgess_at_gmail.com> 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 much appreciated.
>>
>> Sincerely,
>> Erin
>>
>>
>> --
>> Erin Hodgess
>> Associate Professor
>> Department of Computer and Mathematical Sciences
>> University of Houston - Downtown
>> mailto: erinm.hodgess_at_gmail.com
>>
>> ______________________________________________
>> R-help_at_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.
>>

    GaGr> ______________________________________________
    GaGr> R-help_at_r-project.org mailing list
    GaGr> https://stat.ethz.ch/mailman/listinfo/r-help
    GaGr> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html     GaGr> and provide commented, minimal, self-contained, reproducible code.

R-help_at_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. Received on Wed 19 Mar 2008 - 11:02:19 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 Wed 19 Mar 2008 - 11:30:24 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.

list of date sections of archive