Rename ILSAmerge files

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

Quiet often ILSA file names come in codes representing different respondents, and cycles. To make this codes comprehensible, we can use ILSArename() to give new names to merged files.

First, we need to use ILSAmerge() to merge the files:

unlink(file.path(tempdir(),"REDS2021"),recursive = TRUE)
dir.create(file.path(tempdir(),"REDS2021"),showWarnings = FALSE)

ILSAmerge(inputdir = system.file("extdata/reds", package = "ILSAmerge"), 
          outputdir = file.path(tempdir(),"REDS2021"), 
          filetype = c("rds", "zsav", "sav"),quiet = TRUE)

This will create 3 files with codes for respondent and cycle:

list.files(file.path(tempdir(),"REDS2021"))

With ILSArename() we can convert these names:

ILSArename(inputdir = file.path(tempdir(),"REDS2021"))
list.files(file.path(tempdir(),"REDS2021"))
unlink(file.path(tempdir(),"REDS2021"),recursive = TRUE)


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.