Generates a fairly flexible container to log stuff.
init_logger(what, init.size, at = NULL, to = NULL)
what | [ |
---|---|
init.size | [ |
at | [ |
to | [ |
[enviroment
] Logger environment.
update_logger
log = init_logger(c("P" = "list", "f" = "list", "C" = "character"), init.size = 5L, at = c(1, 3)) # note that div is not subject to logging since it was not specified in init_logger update_logger(log, P = matrix(runif(10), ncol = 2L), C = "a", f = runif(10), iter = 1, div = letters[1:3]) update_logger(log, P = matrix(runif(10), ncol = 2L), C = "b", f = runif(10), iter = 2, div = letters[1:3]) update_logger(log, P = matrix(runif(10), ncol = 2L), C = "a", f = runif(10), iter = 3, div = letters[1:3]) print(log$df)#> iter P f C #> 1 1 0.080750.... 0.874600.... a #> 2 3 0.680162.... 0.461186.... a #> 3 0 #> 4 0 #> 5 0