An example action_fn for an analysis
Examples
p <- plnr::Plan$new()
p$add_data("covid_data", fn_name = "plnr::example_data_fn_nor_covid19_cases_by_time_location")
batch_argset_list <- list(
list(name = "analysis_1", var_1 = 1, var_2 = "i"),
list(name = "analysis_2", var_1 = 2, var_2 = "j"),
list(name = "analysis_3", var_1 = 3, var_2 = "k")
)
p$add_analysis_from_list(
fn_name = "plnr::example_action_fn",
l = batch_argset_list
)
p$get_argsets_as_dt()
#> name_analysis index_analysis var_1 var_2
#> 1: analysis_1 1 1 i
#> 2: analysis_2 2 2 j
#> 3: analysis_3 3 3 k
p$run_one("analysis_1")
#> [1] "Data given:"
#> [1] "covid_data" "hash"
#> [1] "Argset given:"
#> [1] "var_1" "var_2" "index_analysis"
#> [1] "var_1" "var_2" "index_analysis"