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: [EMAIL PROTECTED]
>
> ______________________________________________
> [EMAIL PROTECTED] 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

______________________________________________
[EMAIL PROTECTED] 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

Reply via email to