Skip to content

Instantly share code, notes, and snippets.

@JosepER
Created May 24, 2023 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JosepER/247bec8fb9dccee72a35bb3832fcadc9 to your computer and use it in GitHub Desktop.
Save JosepER/247bec8fb9dccee72a35bb3832fcadc9 to your computer and use it in GitHub Desktop.
Examples of how to read multiple files in LISSY
# 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