# Ignore this code block. It loads mock data for CRAN.
# In your analysis, download and load your data using the
# functions `scf_download()` and `scf_load()`
td <- tempfile("design_")
dir.create(td)
src <- system.file("extdata", "scf2022_mock_raw.rds", package = "scf")
file.copy(src, file.path(td, "scf2022.rds"), overwrite = TRUE)
scf2022 <- scf_load(2022, data_directory = td)
# EXAMPLE IMPLEMENTATION: Construct scf_mi_survey object
obj <- scf_design(
design = scf2022$mi_design,
year = 2022,
n_households = attr(scf2022, "n_households")
)
class(obj)
length(obj$mi_design)
# Ignore the code below. It is for CRAN:
unlink(td, recursive = TRUE, force = TRUE)
Run the code above in your browser using DataLab