Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Created February 14, 2013 20:40
Show Gist options
  • Save nassimhaddad/4956206 to your computer and use it in GitHub Desktop.
Save nassimhaddad/4956206 to your computer and use it in GitHub Desktop.
data.files <- dir('data')
for (data.file in data.files)
{
filename <- file.path('data', data.file)
variable.name <- sub('\\.csv$', '', data.file, ignore.case = TRUE, perl = TRUE)
assign(variable.name, read.csv(filename, header = TRUE, sep = ','))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment