library(utils)
foo <- new.env()
foo$b <- 1:10
foo$d <- 1:10
objSize(foo) # all the elements in the environment
utils::object.size(foo) # different - only measuring the environment as an object
utils::object.size(prepInputs) # only the function, without its enclosing environment
objSize(prepInputs) # the function, plus its enclosing environment
os1 <- utils::object.size(as.environment("package:reproducible"))
(os1) # very small -- just the environment container
Run the code above in your browser using DataLab