Displaying 1 result from an estimated 1 matches for "ptrlist".
Did you mean:
ptrdist
2017 Nov 22
2
function pointers?
...ce:
rnormPointer <- function(inputValue1, inputValue2){
object <- new.env(parent=globalenv())
object$distr <- inputValue1
object$n <- inputValue2
class(object) <- 'pointer'
object
}
## Experiment with that
gg <- rnormPointer(rnorm, 33)
gg$distr(gg$n)
ptrList <- vector("list", N)
for(i in seq_along(nsize)) {
ptrList[[i]] <- rnormPointer(rnorm, nsize[i])
}
format(object.size(ptrList), units = "Mb")
The required storage is reduced to 2.6 Mb. Thats 1/10 of the RAM
required for closureList. This thing works in the way I expec...