# NOT RUN {
# Using resp_condition_fun2() to create values across CCHS cycles
# (2005-2007) resp_condition_fun2() is specified in
# variable_details.csv along with the CCHS variables and cycles included.
# To transform resp_condition_der, use rec_with_table() for each CCHS cycle
# and specify resp_condition_der, along with the various respiratory
# variables. Then by using merge_rec_data() you can combine
# resp_condition_der across cycles.
library(cchsflow)
resp2005 <- suppressWarnings(rec_with_table(
cchs2005_p, c(
"DHHGAGE_cont", "CCC_91E", "CCC_91F", "CCC_91A", "CCC_031",
"resp_condition_der"
)
))
head(resp2005)
resp2007_2008 <- suppressWarnings(rec_with_table(
cchs2007_2008_p, c(
"DHHGAGE_cont", "CCC_91E", "CCC_91F", "CCC_91A", "CCC_031",
"resp_condition_der"
)
))
tail(resp2007_2008)
combined_resp <- suppressWarnings(merge_rec_data(resp2005, resp2007_2008))
head(combined_resp)
tail(combined_resp)
# }
Run the code above in your browser using DataLab