Quickly build strata project with minimal input and standard names
Source:R/quick_build.R
build_quick_strata_project.Rd
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 namedstratum_1
,stratum_2
, etc. ands1_lamina_1
,s1_lamina_2
, etc.
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/RtmpRK1XGV/file163d74c2c016/strata/stratum_1/s1_…
#> $ skip_if_fail <lgl> FALSE, FALSE, FALSE, FALSE
#> $ created <date> 2024-11-27, 2024-11-27, 2024-11-27, 2024-11-27
main(tmp)
#> [2024-11-27 15:57:03.0417] INFO: Strata started
#> [2024-11-27 15:57:03.0421] INFO: Stratum: stratum_1 initialized
#> [2024-11-27 15:57:03.0424] INFO: Lamina: s1_lamina_1 initialized
#> [2024-11-27 15:57:03.0428] INFO: Executing: my_code
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2024-11-27 15:57:03.0434] INFO: Lamina: s1_lamina_1 finished
#> [2024-11-27 15:57:03.0437] INFO: Lamina: s1_lamina_2 initialized
#> [2024-11-27 15:57:03.0439] INFO: Executing: my_code
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2024-11-27 15:57:03.0445] INFO: Stratum: stratum_1 finished
#> [2024-11-27 15:57:03.0448] INFO: Stratum: stratum_2 initialized
#> [2024-11-27 15:57:03.0451] INFO: Lamina: s1_lamina_2 finished
#> [2024-11-27 15:57:03.0453] INFO: Lamina: s2_lamina_1 initialized
#> [2024-11-27 15:57:03.0456] INFO: Executing: my_code
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2024-11-27 15:57:03.0461] INFO: Lamina: s2_lamina_1 finished
#> [2024-11-27 15:57:03.0464] INFO: Lamina: s2_lamina_2 initialized
#> [2024-11-27 15:57:03.0466] INFO: Executing: my_code
#> [1] "I am a placeholder, do not forget to replace me!"
#> [2024-11-27 15:57:03.0472] INFO: Strata finished - duration: 0.0056 seconds
fs::dir_delete(tmp)