# environments are reference objects, not copied e <- new.env() e$count <- 0 bump <- function(env) { # this mutates the shared environment env$count <- env$count + 1 } bump(e) bump(e) print(e$count)
environments are not copied