This function takes output produced from a slimr_script
which uses
r_output
, and converts it into a tibble
slim_extract_output_data(output)
Character vector produced from SLiM run.
A tibble
with four columns:
A vector of generations where output was produced.
Names of the output data.
The SLiM expression used to generate the output.
The raw data output from SLiM as a character vector.
if(slim_is_avail()) {
test_sim <- slim_script(
slim_block_init_minimal(),
slim_block_add_subpops(1, 100),
slim_block(1, 20, late(), {
r_output(p1$size(), "MS", do_every = 10)
})
) %>%
slim_run(simple = TRUE)
slim_extract_output_data(test_sim$output)
}
#>
#>
#> Simulation finished with exit status: 0
#>
#> Success!
#> $data
#> # A tibble: 2 × 5
#> generation name expression type data
#> <int> <chr> <chr> <chr> <chr>
#> 1 10 MS p1.size() "integer [0:0] 1\n" 1
#> 2 20 MS p1.size() "integer [0:0] 1\n" 1
#>
#> $extra_out
#> character(0)
#>
#> $leftovers
#> character(0)
#>
#> $last_line
#> [1] 23
#>