Re: [R] dimensions of a all objects

From: ONKELINX, Thierry <Thierry.ONKELINX_at_inbo.be>
Date: Tue 09 Jan 2007 - 14:47:38 GMT


You need something like this:
sapply(objects() , function(x)(dim(eval(parse(text = x)))))

a <- rnorm(1)
b <- matrix(rnorm(4), ncol = 2, nrow = 2) sapply(objects() , function(x)(dim(eval(parse(text = x)))))

$a

NULL
$b

[1] 2 2

Cheers,

Thierry



ir. Thierry Onkelinx

Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature and Forest

Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance

Gaverstraat 4

9500 Geraardsbergen

Belgium

tel. + 32 54/436 185

Thierry.Onkelinx@inbo.be

www.inbo.be  

Do not put your faith in what statistics say until you have carefully considered what they do not say. ~William W. Watt

A statistical analysis, properly conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney

-----Oorspronkelijk bericht-----
Van: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] Namens Farrel Buchinsky Verzonden: dinsdag 9 januari 2007 15:30
Aan: r-help@stat.math.ethz.ch
Onderwerp: [R] dimensions of a all objects

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))

-- 
Farrel Buchinsky

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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.

______________________________________________
R-help@stat.math.ethz.ch 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 Jan 10 06:45:10 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 09 Jan 2007 - 20:30:31 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.