[R] modes of objects

Berton Gunter gunter.berton at gene.com
Fri May 28 01:40:28 CEST 2004


sapply(ls(), function(x)mode(get(x)))

Cheers,
Bert

Laura Holt wrote:

> Hi R People:
>
> I am looking for some objects:
>
> >objects(pat="f")
> [1] "dufus"   "f"       "f1"      "fake.df" "ff"      "fm1"     "one.df"
> "one1.df" "x.df"    "xf"
> >mode(objects(pat="f"))
> [1] "character"
> >
>
> I would like to determine the mode of these objects.  For instance, dufus
> and f are functions, while fake.df and one.df are data frames.
>
> I tried writing to a list, but still can't get it!
>
> Thanks in advance!
>
> Laura
> mailto: lauraholt_983 at hotmail.com
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--

Bert Gunter

Non-Clinical Biostatistics
Genentech
MS: 240B
Phone: 650-467-7374


"The business of the statistician is to catalyze the scientific learning
process."

 -- George E.P. Box




More information about the R-help mailing list