# NOT RUN {
# Using SMKG040_fun() to create age values across CCHS cycles
# SMKG040_fun() is specified in variable_details.csv under SMKG040_cont.
# To create a continuous harmonized variable for SMKG040, use rec_with_table()
# for each CCHS cycle and specify SMKG040_cont.
library(cchsflow)
age_smoke_dfd_2009_2010 <- rec_with_table(
cchs2009_2010_p, c(
"SMKG203_cont", "SMKG207_cont","SMKG040_cont"
)
)
head(age_smoke_dfd_2009_2010)
age_smoke_dfd_2011_2012 <- rec_with_table(
cchs2011_2012_p,c(
"SMKG203_cont", "SMKG207_cont","SMKG040_cont"
)
)
tail(age_smoke_dfd_2011_2012)
combined_age_smoke_dfd <- suppressWarnings(merge_rec_data
(age_smoke_dfd_2009_2010,age_smoke_dfd_2011_2012))
head(combined_age_smoke_dfd)
tail(combined_age_smoke_dfd)
# }
Run the code above in your browser using DataLab