Farrel Buchinsky wrote:
> Why will the following command not work
> sapply(objects(),dim)
> What does it say about the objects list? What does it say about the dim
> command?
>
> Likewise, the following also does not work
> all<-ls()
> for (f in all) print(dim(f))
'objects()' returns character strings - the names of objects - then
the dim of the character strings are all NULL.
I'll assume that's what you are getting at - you've not posted an
example or the output you are getting or why it 'does not work'.
Maybe you want this:
> sapply(objects(),function(x){dim(get(x))})
$f
NULL
$m
[1] 2 5
$x
NULL
$y
[1] 5 2
- where m and y are matrices, f is a function, x is a scalar.
Barry
______________________________________________
[email protected] 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.