[R] Loop over folder files
ruipbarradas at sapo.pt
ruipbarradas at sapo.pt
Mon Aug 22 19:32:31 CEST 2016
Hello,
That argument doesn't exist, hence the error.
Read the help page ?read.dta more carefully. You will see that already
read.dta reads into a data.frame.
Hope this helps,
Rui Barradas
Citando Juan Ceccarelli Arias <jfca283 at gmail.com>:
> 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]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.htmland provide commented,
> minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help
mailing list