This is copy paste from my session:
xyz-as.vector(c(ls(),as.matrix(lapply(ls(),class
dim(xyz)-c(length(xyz)/2,2)
allobj-function(){
+ xyz-as.vector(c(ls(),as.matrix(lapply(ls(),class;
+ dim(xyz)-c(length(xyz)/2,2);
+ return(xyz)
+ }
xyz
[,1] [,2]
[1,] a
On Feb 20, 2012, at 10:07 AM, Ajay Askoolum wrote:
This is copy paste from my session:
xyz-as.vector(c(ls(),as.matrix(lapply(ls(),class
dim(xyz)-c(length(xyz)/2,2)
allobj-function(){
+ xyz-as.vector(c(ls(),as.matrix(lapply(ls(),class;
+ dim(xyz)-c(length(xyz)/2,2);
+ return(xyz)
+
Sorry, just checked it and you need to add .GlobalEnv to both ls() calls.
Michael
On Mon, Feb 20, 2012 at 10:17 AM, R. Michael Weylandt
michael.weyla...@gmail.com wrote:
Short answer, environments -- ls() looks (by default) in its current
environment, which is not the same as the global
Short answer, environments -- ls() looks (by default) in its current
environment, which is not the same as the global environment when
being called inside a function.
This would (I think) give the same answer but I haven't checked it. :
allobj-function(){
+
Hi
This is copy paste from my session:
xyz-as.vector(c(ls(),as.matrix(lapply(ls(),class
dim(xyz)-c(length(xyz)/2,2)
allobj-function(){
+ xyz-as.vector(c(ls(),as.matrix(lapply(ls(),class;
+ dim(xyz)-c(length(xyz)/2,2);
+ return(xyz)
+ }
xyz
[,1] [,2]
5 matches
Mail list logo