active_transport1_fun: Daily active transportation (2001-2005)

View source: R/active-transportation.R

active_transport1_funR Documentation

Daily active transportation (2001-2005)

Description

This function creates a derived variable for daily time spent traveling in active ways. This includes walking and biking. This function is used for CCHS 2001-2005.

Usage

active_transport1_fun(PAC_4A_cont, PAC_4B_cont)

Arguments

PAC_4A_cont

number of hours walk work/school in week in the past 3 months.

PAC_4B_cont

number of hours bike work/school in week in the past 3 months.

Value

Continuous variable for active transportation (active_transport)

Examples

# Using active_transport1_fun() to determine daily time spent 
# traveling in active ways values across CCHS 2001-2005.

# active_transport1_fun() is specified in variable_details.csv along with the CCHS
# variables and cycles included.

# To transform active_transport across cycles, use rec_with_table() for each
# CCHS cycle and specify active_transport, along with each activity variable.
# Then by using merge_rec_data(), you can combine active_transport across
# cycles

library(cchsflow)
active_transport2001 <- rec_with_table(
  cchs2001_p, c(
    "PAC_4A_cont", "PAC_4B_cont", "active_transport"
  )
)

head(active_transport2001)

active_transport2005 <- rec_with_table(
  cchs2005_p, c(
    "PAC_4A_cont", "PAC_4B_cont", "active_transport"
  )
)

tail(active_transport2005)

combined_active_transport <- suppressWarnings(merge_rec_data(active_transport2001,
 active_transport2005))

head(combined_active_transport)
tail(combined_active_transport)

cchsflow documentation built on May 28, 2022, 1:09 a.m.