[R] Loop over folder files

Juan Ceccarelli Arias jfca283 at gmail.com
Mon Aug 22 18:33:34 CEST 2016


Hi
I need to apply some code over some stata files that are in folder.
I've wrote this

library(foreign)

fuente=list.files("C:/Users/Jceccarelli/Bases/Stata", pattern="dta$",
full.names=FALSE)

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

xxx=read.dta(fuente[i], to.data.frame=TRUE)


}

But i get this error

Error in read.dta(fuente[i], to.data.frame = TRUE) :
  unused argument (to.data.frame = TRUE)

What am i doing wrong?

	[[alternative HTML version deleted]]



More information about the R-help mailing list