# Mock workflow for CRAN (demo only — not real SCF data)
td <- tempdir()
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)
scf_plot_dist(scf2022, ~own)
scf_plot_dist(scf2022, ~age, bins = 10)
unlink("scf2022.rds", force = TRUE)
# \donttest{
# Real workflow
scf_download(2022)
scf2022 <- scf_load(2022)
scf_plot_dist(scf2022, ~own)
scf_plot_dist(scf2022, ~age, bins = 10)
# Clean up
unlink("scf2022.rds", force = TRUE)
# }
Run the code above in your browser using DataLab