Load ILSA files

knitr::opts_chunk$set(
  collapse = TRUE
)
library(ILSAmerge)

Check what can be loaded

Using ILSAfile.info() we can identify different populations within an ILSA.

Moreover, we can also use this information for loading an specific population into the memory. Using the 'REDS' 2021 example data provided by this package:

ILSAfile.info(inputdir = system.file("extdata/reds", package = "ILSAmerge"))

Load all information

We can decide to load a population, like BCGV1, using justload():

loaded <- justload(inputdir = system.file("extdata/reds", package = "ILSAmerge"),
         population = "BCGV1")

This will result in a list of elements loaded by haven, in our example, a list of 11 elements:

class(loaded)

length(loaded)

loaded[[1]]

Load only column information

For some purposes, we might need to load only the column information, most probably to check if the attributes are correct. We can do this by setting justattributes = TRUE:

loaded <- justload(inputdir = system.file("extdata/reds", package = "ILSAmerge"),
         population = "BCGV1", justattributes = TRUE)

This will load all 11 datasets with 0 rows each:

length(loaded)

loaded[[1]]


Try the ILSAmerge package in your browser

Any scripts or data that you put into this service are public.

ILSAmerge documentation built on April 11, 2025, 5:54 p.m.