# NOT RUN {
# Using low_drink_score_fun1() to create low_drink_score values across
# CCHS cycles low_drink_score_fun1() is specified in variable_details.csv
# along with the CCHS variables and cycles included.
# To transform low_drink_score1, use rec_with_table() for each CCHS cycle
# and specify low_drink_score1, along with the various alcohol and sex
# variables.
# Using merge_rec_data(), you can combine low_drink_score1 across cycles.
library(cchsflow)
low_drink2001 <- rec_with_table(
cchs2001_p, c(
"DHH_SEX", "ALWDWKY", "ALC_005", "ALC_1", "low_risk_score"
)
)
head(low_drink2001)
low_drink2009_2010 <- rec_with_table(
cchs2009_2010_p, c(
"DHH_SEX", "ALWDWKY", "ALC_005", "ALC_1", "low_risk_score"
)
)
tail(low_drink2009_2010)
combined_low_drink1 <- bind_rows(low_drink2001,
low_drink2009_2010)
head(combined_low_drink1)
tail(combined_low_drink1)
# }
Run the code above in your browser using DataLab