R/slimr_output.R
r_output_sex.Rd
Utility function to tell SLim to output sexes of individuals
r_output_sex(name = "sex", ...)
slimr_output_sex(name = "sex", ...)
Name of output to use to label it in slimr_results object
. Default is "sex"
.
Other arguments to be passed to r_output
None
if(slim_is_avail()) {
test_sim <- slim_script(
slim_block_init_minimal(mutation_rate = 1e-6),
slim_block_add_subpops(1, 100),
slim_block(1, 20, late(), {
r_output_sex("sex", do_every = 10)
})
) %>%
slim_run()
slim_results_to_data(test_sim$output_data)
}
#>
#>
#> Simulation finished with exit status: 0
#>
#> Success!
#> # A tibble: 2 × 5
#> type expression generation name data
#> <chr> <chr> <int> <chr> <lis>
#> 1 "string [0:99] \"H\" \"H\" ...\n" sim.subpopulations.i… 10 sex <chr>
#> 2 "string [0:99] \"H\" \"H\" ...\n" sim.subpopulations.i… 20 sex <chr>