[R] "a binary read error occurred" in read.dta

C Barrington-Leigh cpblPublic at gmail.com
Mon Feb 2 13:46:23 CET 2009


I'm trying to read in a perfectly good Stata data file created using
Stata 10 in Linux and saved in the version 8/9 format using "saveold".

R fails to read in the file:

 aa<-read.dta("myfile.dta")
Error in read.dta("myfile.dta"):
  a binary read error occurred

If I resave the file in Stata using the "nolabels" option of saveold,
I get:

There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In read.dta("myfilev8nolabel.dta") :
  value labels (GEOEGPRV) for GEOEGPRV are missing

and many more such messages. That is, in this case it appears to read
in the file but complains.

I would liike  to read in the file *with* labels. Has anyone else had
experience with this "binary read" error?
Thanks,
Chris




More information about the R-help mailing list