Skip to contents

build_quick_strata_project will create a project with the specified number of strata - num_strata, with the specified number of laminae

  • num_laminae_per per stratum. The strata and laminae will be named stratum_1, stratum_2, etc. and s1_lamina_1, s1_lamina_2, etc.

Usage

build_quick_strata_project(project_path, num_strata = 1, num_laminae_per = 1)

Arguments

project_path

A path to strata project folder.

num_strata

Number of strata to create.

num_laminae_per

Number of laminae to create per stratum.

Value

invisible dataframe of the survey of the strata project.

Examples

tmp <- fs::dir_create(fs::file_temp())
result <- build_quick_strata_project(tmp, 2, 2)
dplyr::glimpse(result)
#> Rows: 4
#> Columns: 7
#> $ execution_order <int> 1, 2, 3, 4
#> $ stratum_name    <chr> "stratum_1", "stratum_1", "stratum_2", "stratum_2"
#> $ lamina_name     <chr> "s1_lamina_1", "s1_lamina_2", "s2_lamina_1", "s2_lamin…
#> $ script_name     <chr> "my_code", "my_code", "my_code", "my_code"
#> $ script_path     <fs::path> "/tmp/RtmpKn24Yq/file1e504746b116/strata/stratum_1/s1_…
#> $ skip_if_fail    <lgl> FALSE, FALSE, FALSE, FALSE
#> $ created         <date> 2025-02-03, 2025-02-03, 2025-02-03, 2025-02-03
main(tmp)
#> [2025-02-03 21:45:56.8149] INFO: Strata started 
#> [2025-02-03 21:45:56.8153] INFO: Stratum: stratum_1 initialized 
#> [2025-02-03 21:45:56.8157] INFO: Lamina: s1_lamina_1 initialized 
#> [2025-02-03 21:45:56.8162] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-02-03 21:45:56.8169] INFO: Lamina: s1_lamina_1 finished 
#> [2025-02-03 21:45:56.8173] INFO: Lamina: s1_lamina_2 initialized 
#> [2025-02-03 21:45:56.8176] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-02-03 21:45:56.8325] INFO: Stratum: stratum_1 finished 
#> [2025-02-03 21:45:56.8329] INFO: Stratum: stratum_2 initialized 
#> [2025-02-03 21:45:56.8333] INFO: Lamina: s1_lamina_2 finished 
#> [2025-02-03 21:45:56.8336] INFO: Lamina: s2_lamina_1 initialized 
#> [2025-02-03 21:45:56.8340] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-02-03 21:45:56.8347] INFO: Lamina: s2_lamina_1 finished 
#> [2025-02-03 21:45:56.8350] INFO: Lamina: s2_lamina_2 initialized 
#> [2025-02-03 21:45:56.8354] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-02-03 21:45:56.8360] INFO: Strata finished - duration: 0.0213 seconds 
fs::dir_delete(tmp)