Re: [R] Using object.size inside a function

2010-04-13 Thread Duncan Murdoch
On 13/04/2010 8:43 AM, Bos, Roger wrote: When I encounter memory errors, I like to see the size of the objects in memory, so I modified one of the examples: z <- sapply(ls(), function(x) object.size(get(x))) as.matrix(rev(sort(z))[1:10]) This works fine if I run it as is, but if I try t

[R] Using object.size inside a function

2010-04-13 Thread Bos, Roger
When I encounter memory errors, I like to see the size of the objects in memory, so I modified one of the examples: z <- sapply(ls(), function(x) object.size(get(x))) as.matrix(rev(sort(z))[1:10]) This works fine if I run it as is, but if I try to place it inside a function, I get an erro