Examples for 'pryr::object_size'


Compute the size of an object.

Aliases: object_size compare_size

Keywords:

### ** Examples

# object.size doesn't keep track of shared elements in an object
# object_size does
x <- 1:1e4
z <- list(x, x, x)
compare_size(z)
  base   pryr 
120224    760 
# this means that object_size is not transitive
object_size(x)
680 B
object_size(z)
760 B
object_size(x, z)
760 B
# object.size doesn't include the size of environments, which makes
# it easy to miss objects that are carrying around large environments
f <- function() {
  x <- 1:1e4
  a ~ b
}
compare_size(f())
base pryr 
 728 3736 

[Package pryr version 0.1.6 Index]