Skip to content

Instantly share code, notes, and snippets.

@thomas-kassel
Created February 11, 2017 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomas-kassel/97fda845324d7c81b82af1c0659d34aa to your computer and use it in GitHub Desktop.
Save thomas-kassel/97fda845324d7c81b82af1c0659d34aa to your computer and use it in GitHub Desktop.
Import of NHANES data tables
setwd('./tables')
# Loop through directory with all input tables as CSV's
# Save as dataframes in R environment for shiny use
for (i in 1:length(dir())){
tablename <- unlist(strsplit(dir()[i],'.csv'))[1]
table <- read.csv(dir()[i],stringsAsFactors = F,colClasses = c(seqID='character'))
assign(tablename,table)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment