Skip to content
Prev 167130 / 398503 Next

Summary of Total Object.Size in R Script

See also ll() in the R.oo package, e.g.

# To list all objects in .GlobalEnv:
ll()
                  member data.class dimension objectSize
1                *tmp*     Person         1         428
2  as.character.Person   function      NULL        1208
3              country  character         1          44
4        equals.Person   function      NULL        2324
5             filename  character         1          84
6               getAge   function      NULL         372
7        getAge.Person   function      NULL         612
8       getName.Person   function      NULL         628
9      hashCode.Person   function      NULL        1196
10        last.warning       list         1         192
11                 obj     Person         1         428
12              Person      Class      NULL        2292
13              setAge   function      NULL         372
14       setAge.Person   function      NULL        2088
15             setName   function      NULL         372
16      setName.Person   function      NULL         760
17   staticCode.Person   function      NULL        2372

# To list all functions in the methods package:
ll(mode="function", envir="methods")

# To list all numeric and character object in the base package:
ll(mode=c("numeric", "character"), envir="base")

# To list all objects in the base package greater than 40kb:
subset(ll(envir="base"), objectSize > 40000)

ll() takes argument 'properties', which allows you to construct any
column property you ever like.  There is also a 'sortBy' argument.
See help(ll) for more details.

/Henrik
On Thu, Jan 15, 2009 at 3:00 AM, Gundala Viswanath <gundalav at gmail.com> wrote: