R/data_grid_to_fun.R

Defines functions data_grid_to_fun

data_grid_to_fun <- function(data_grid, envir) {
  lapply(seq_len(nrow(data_grid)), function(i) {
    fp <- extract_fun_and_parameter(data_grid[i, , drop = FALSE], envir)
    ret <- function() do.call(fp$fun, fp$para)
    attr(ret, ".truth") <- attr(fp$fun, ".truth")
    ret
  })
}

Try the simTool package in your browser

Any scripts or data that you put into this service are public.

simTool documentation built on Jan. 8, 2021, 2:25 a.m.