This function allows users to merge CCHS data transformed by the
rec_with_table
function. This function generates a labelled
merged data frame with multiple transformed CCHS cycles.
merge_rec_data(...)
... | recoded data frames to be merged. |
---|
a merged data frame consisting of multiple recoded CCHS cycles with labels for variable names and tags for variables not included in particular CCHS cycles.
When merging recoded CCHS data, there are variables that are missing in certain CCHS cycles. This function tags missing variable observations as NA(c), indicating that the variable was not asked or included in the CCHS cycle of the respondent.
Click here for more details on how NA's are treated in cchsflow.
# Merging two CCHS cycles with variables missing in each cycle. # INCGHH_A is a cchsflow variable available for the 2001 CCHS cycle, while # INCGHH_B is a cchsflow variable available for the 2003 CCHS cycle. # Using merge_rec_data(), datasets containing INCGHH_A & INCGHH_B can be # merged and tagged. library(cchsflow) income2001 <- rec_with_table(cchs2001_p, "INCGHH_A")#>#>#>#>#>#>#>#>#> INCGHH_A INCGHH_B #> 1 3 NA(c) #> 2 3 NA(c) #> 3 6 NA(c) #> 4 3 NA(c) #> 5 4 NA(c) #> 6 4 NA(c)#> INCGHH_A INCGHH_B #> 395 NA(c) 3 #> 396 NA(c) 5 #> 397 NA(c) NA(b) #> 398 NA(c) 2 #> 399 NA(c) 1 #> 400 NA(c) 1