Created
August 4, 2016 15:22
-
-
Save ckholmes5/c9b929adc0f1bef65b3987a0c1c3d863 to your computer and use it in GitHub Desktop.
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
years = c(1999, 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014) | |
df = data.frame() | |
for (year in years) { | |
df1 = read.sas7bdat(paste('FARS ', year, '/acc_aux.sas7bdat', sep='')) | |
print(year) | |
if (year > 2012) { | |
drops = c('A_PEDAL_F', 'A_PED_F') | |
df1 = df1[, !(names(df1) %in% drops)] | |
} | |
df = rbind(df, df1) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment