Skip to content

Instantly share code, notes, and snippets.

library(tidyverse)
# Exercise 1
years <- c("08", "10", "14", "16")
# append all IT datasets from 2008 to 2016
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)
@JosepER
JosepER / reading_multiple_datasets_lissy.R
Created May 24, 2023 07:50
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")
@JosepER
JosepER / lissyrtools_example.R
Last active September 15, 2023 08:55
lissyrtools example
library(lissyrtools)
library(magrittr)
files_h <- read_lissy_files(c("ca14h", "ca15h", "ca16h", "ca17h", "ca18h", "ca19h"),
col_select = "dhi")
files_p <- read_lissy_files(c("ca14p", "ca15p", "ca16p", "ca17p", "ca18p", "ca19p"),
col_select = c("pi11", "age"))
lissy_datasets <- merge_dataset_levels(files_h, files_p)