Generates a fairly flexible container to log stuff.
log_init(what, init.size, at = NULL, to = NULL)
what | [ |
---|---|
init.size | [ |
at | [ |
to | [ |
Logger environment.
log_update
log = log_init(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 log_init log_update(log, P = matrix(runif(10), ncol = 2L), C = "a", f = runif(10), iter = 1, div = letters[1:3]) log_update(log, P = matrix(runif(10), ncol = 2L), C = "b", f = runif(10), iter = 2, div = letters[1:3]) log_update(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.600760.... 0.034241.... a #> 2 3 0.641679.... 0.174675.... a #> 3 0 #> 4 0 #> 5 0