Readings Lots of CSV Files in #Rstats

Assign Names to Objects Based on Names of Files in a Directory using R for a large number of input csv files

getwd()

setwd(“C:/Users/KUs/Desktop/delhi crimes”)

a=dir()

for(i in 1:length(a)){

assign(paste(a[i]),(read.csv(a[i],header=T,sep=“,”)))

}

ls()

Unknown's avatar

Author: Ajay Ohri

http://about.me/ajayohri

Leave a comment