Learn R Programming

reproducible (version 0.2.0)

objSize: Recursive object.size

Description

This has methods for various types of things that may not correctly report their object.size using object\.size. Also, for lists and environments, it will return the object.size separately for each element.

Usage

objSize(x, quick)

# S3 method for list objSize(x, quick = getOption("reproducible.quick", FALSE))

# S3 method for environment objSize(x, quick = getOption("reproducible.quick", FALSE))

# S3 method for default objSize(x, quick = getOption("reproducible.quick", FALSE))

# S3 method for Path objSize(x, quick = getOption("reproducible.quick", FALSE))

Arguments

x

An object

quick

Logical. Only some methods use this. e.g., Path class objects. In which case, file.size will be used instead of object.size.

Examples

Run this code
# NOT RUN {
a <- new.env()
a$b <- 1:10
a$d <- 1:10

objSize(a) # all the elements in the environment
object.size(a) # different - only measuring the environment as an object
# }

Run the code above in your browser using DataLab