sjewo / readstata13

Package to read the Stata 13 (and newer) file format into a R data.frame
https://sjewo.github.io/readstata13/
GNU General Public License v2.0
41 stars 9 forks source link

File not found #44

Closed ericmelse closed 7 years ago

ericmelse commented 7 years ago

Although I am certain that the Stata13 file is located in the directory: setwd("C:/Ftpfolder/StataStuff/dta13") I get the error "File not found" using this syntax: dat <- read.dta13(system.file("auto13.dta", package="readstata13"), convert.factors=FALSE) What am I doing wrong?

JanMarvin commented 7 years ago

Hey, if the file you are trying to read is in that folder, check it with dir(), importing should work like this dat <- read.dta13("auto13.dta", convert.factors=FALSE). The system.file part is only required for our tests with files we ship with the package, not for enduser files. Hope that helps, Marvin

ericmelse commented 7 years ago

Dear Marvin, Yes! This works, and I also was able to export a R data frame and save it as a Stata dta file. Many thanks for your quick advise as well as for this cool package. (When time permits, you might consider a similar package for the Stata 14 dta format.)

JanMarvin commented 7 years ago

Dear Eric, that is already implemented. You can import Stata 14 dta-files and write Stata 14 dta-file. Have a look at the help pages. Marvin