A result is first written to a directory in cache,
and then read into a data.frame.
If a previous result with exactly the same arguments is found in cache,
it is read without calling tekka.
Usage
tekka(args = character(0L), cache = NULL)Arguments
- args
Command line arguments as a string vector. See
tekkamanual andtekka("--help")for available options. Note that a random--seedis appended if not given. Useset.seed()or--seedexplicitly for reproducibility and caching.- cache
Parent directory for tekka output.
TRUEis equivalent to "." (current directory).tempdir()is used in other cases including the default (NULL), which is discarded at the end of an R session. SetFALSEto forcetekkato run and overwrite previous results if any.
Value
A data.frame read by read_tekka().
See also
tekka_path() to get information about the tekka installation.
Examples
set.seed(666)
# tekka("--help")
result = tekka("-y25 -l2 --sa 2,2 --sj 2,2")
result |> dplyr::select(!"outdir")
#> # A tibble: 1 × 16
#> carrying_capacity fishing_coef fishing_mortality last migration_matrices
#> <dbl> <list> <list> <int> <list>
#> 1 2000 <list [0]> <dbl [84]> 2 <dbl [9 × 4 × 4]>
#> # ℹ 11 more variables: natural_mortality <list>, origin <int>,
#> # overdispersion <dbl>, recruitment <dbl>, sample_size_adult <list>,
#> # sample_size_juvenile <list>, seed <int>, weight_for_age <list>,
#> # years <int>, sample_family <list>, demography <list>
result$sample_family[[1L]]
#> # A tibble: 150 × 6
#> id father_id mother_id birth_year location capture_year
#> <int> <int> <int> <int> <int> <int>
#> 1 21 0 0 -4 NA NA
#> 2 20 21 21 0 NA NA
#> 3 22 21 21 0 NA NA
#> 4 19 20 22 7 NA NA
#> 5 24 21 21 0 NA NA
#> 6 25 21 21 0 NA NA
#> 7 23 24 25 4 NA NA
#> 8 18 19 23 13 NA NA
#> 9 28 21 21 0 NA NA
#> 10 27 20 28 7 NA NA
#> # ℹ 140 more rows
result$demography[[1L]]
#> # A tibble: 1,300 × 5
#> year season location age count
#> <int> <int> <int> <int> <int>
#> 1 0 0 0 0 2000
#> 2 0 1 0 0 1227
#> 3 0 2 0 0 787
#> 4 0 3 0 0 469
#> 5 4 0 0 0 2036
#> 6 4 0 0 4 24
#> 7 4 1 0 0 1284
#> 8 4 1 0 4 20
#> 9 4 2 0 0 817
#> 10 4 2 0 4 18
#> # ℹ 1,290 more rows