Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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