Created
May 24, 2023 07:50
-
-
Save JosepER/247bec8fb9dccee72a35bb3832fcadc9 to your computer and use it in GitHub Desktop.
Examples of how to read multiple files in LISSY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an example of how to read multiple files at once in LISSY | |
# To read multiple years of one country: | |
library(tidyverse) | |
years <- c("08", "10", "14", "16") | |
it_df <- purrr::map_dfr(.x = years, | |
.f = ~read.LIS(glue::glue("it{.x}p"), vars = c("year", "educlev", "educ_c", "enroll", "sex", "age" ))) | |
table(it_df$educlev, it_df$educ_c) | |
# OR to read multiple datasets: | |
library(tidyverse) | |
ccyy <- c("it08", "at10", "be14") | |
df <- purrr::map_dfr(.x = ccyy, | |
.f = ~read.LIS(glue::glue("{.x}p"), vars = c("year", "educlev", "educ_c", "enroll", "sex", "age" ))) | |
nrow(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment