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()

Author: Ajay Ohri

http://about.me/ajayohri

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: