Created
February 11, 2017 17:01
-
-
Save thomas-kassel/04565d89dbefe767f1ea217223aa7dc6 to your computer and use it in GitHub Desktop.
Join NHANES tables by sequence ID
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Reshape2 to melt exercise data from "wide" to "long" format | |
# Perform left_join on sequence ID to combine exercise information with demographic | |
exerciseMins <- melt(data = exercise,id.vars = "seqID", | |
measure.vars = c('minsVigWork','minsModWork','minsWalkBike','minsVigRec','minsModRec'), | |
variable.name = 'exercise.type',value.name = 'mins.per.day') %>% | |
left_join(demographics,by='seqID') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment