
Add replicate pattern in survey design with weight and replicate files
Source:R/utils.R
add_replicate.Rd
Add replicate pattern in survey design with weight and replicate files
Usage
add_replicate(
weight,
replicate_pattern,
replicate_path = NULL,
replicate_id = NULL,
replicate_type
)
Arguments
- weight
String with name of weight in survey
- replicate_pattern
String with replicate pattern for columns names regex expression
- replicate_path
String with replicate file path
- replicate_id
String with replicate ID use to join with survey
- replicate_type
String with replicate type, e.g. "bootstrap", "jackknife"
Value
List of replicate parameters. It will be used to create a replicate object in the survey design.
Examples
add_replicate(
weight = "W",
replicate_pattern = "wr[0-9]+",
replicate_path = here::here(
"example-data",
"ech",
"ech_2023",
"pesos replicados Bootstrap anual 2023.xlsx"
),
replicate_id = c("ID" = "ID"),
replicate_type = "bootstrap"
)
#> $weight
#> [1] "W"
#>
#> $replicate_pattern
#> [1] "wr[0-9]+"
#>
#> $replicate_path
#> [1] "/home/runner/work/metasurvey/metasurvey/example-data/ech/ech_2023/pesos replicados Bootstrap anual 2023.xlsx"
#>
#> $replicate_id
#> ID
#> "ID"
#>
#> $replicate_type
#> [1] "bootstrap"
#>