Skip to contents

Attempts to convey harmonies in an existing harmony file to a new harmony file for different survey(s). This is useful when introducing a new vintage of an existing survey, and some of the already-specified harmonies may be valid for the new vintage.

Usage

conveyHarmony(from, to, overwrite = FALSE)

Arguments

from

Character. Name of the .R harmony file with existing harmonies of interest (e.g. "RECS_2015__ACS_2019.R")

to

Character. Name of desired new harmony file (e.g. "RECS_2015__ACS_2015.R").

overwrite

Logical. If to already exists, should it be overwritten? Default is FALSE.

Value

The to harmony file is written to disk (at /harmony/harmonies), if valid harmonies are detected. The list object with retained harmonies is written to disk using internal function at harmony/R/harmony2dotR.R. Possible message printed to console indicating harmonies that are not strictly valid but should be explored manually via harmony app.

Details

For a harmony in from to be considered valid for to, it must match exactly on variable names and all factor levels (if present). User should always manually check the to .R file before using it for analysis!

Examples

conveyHarmony(from = "RECS_2015__ACS_2019.R", to = "RECS_2015__ACS_2015.R")