search for: list_u2

Displaying 1 result from an estimated 1 matches for "list_u2".

Did you mean: list_2
2012 Jul 12
1
Modifying a list: what gets copied?
...suggests that the list doesn't make a deep copy, but the overhead for modifying a list is considerably higher than modifying a list (roughly equivalent to copying a integer vector of 50,000 elements) To make sure it wasn't just the way I was modifying the list, I tried a few alternatives: list_u2 <- function(x) z[[2]] <- 1L list_u3 <- function(x) z[["a"]] <- 1L list_u4 <- function(x) z[1] <- list(1L) microbenchmark( list_u(zs$e4), list_u2(zs$e4), list_u3(zs$e4), list_u4(zs$e4) ) Unit: microseconds expr min lq median uq max 1 list_u(zs$e...