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/RtmpLS5k5l/file1c2c2b579f1a/strata/stratum_1/s1_…
#> $ skip_if_fail    <lgl> FALSE, FALSE, FALSE, FALSE
#> $ created         <date> 2025-03-05, 2025-03-05, 2025-03-05, 2025-03-05
main(tmp)
#> [2025-03-05 13:50:29.1195] INFO: Strata started 
#> [2025-03-05 13:50:29.1199] INFO: Stratum: stratum_1 initialized 
#> [2025-03-05 13:50:29.1203] INFO: Lamina: s1_lamina_1 initialized 
#> [2025-03-05 13:50:29.1208] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-03-05 13:50:29.1215] INFO: Lamina: s1_lamina_1 finished 
#> [2025-03-05 13:50:29.1219] INFO: Lamina: s1_lamina_2 initialized 
#> [2025-03-05 13:50:29.1223] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-03-05 13:50:29.1230] INFO: Stratum: stratum_1 finished 
#> [2025-03-05 13:50:29.1233] INFO: Stratum: stratum_2 initialized 
#> [2025-03-05 13:50:29.1237] INFO: Lamina: s1_lamina_2 finished 
#> [2025-03-05 13:50:29.1241] INFO: Lamina: s2_lamina_1 initialized 
#> [2025-03-05 13:50:29.1244] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-03-05 13:50:29.1251] INFO: Lamina: s2_lamina_1 finished 
#> [2025-03-05 13:50:29.1254] INFO: Lamina: s2_lamina_2 initialized 
#> [2025-03-05 13:50:29.1258] INFO: Executing: my_code 
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2025-03-05 13:50:29.1264] INFO: Strata finished - duration: 0.0071 seconds 
fs::dir_delete(tmp)