[R] write.dta limits

Thomas Lumley tlumley at u.washington.edu
Tue Jun 7 16:06:42 CEST 2005


On Tue, 7 Jun 2005, David Whiting wrote:

>
> When I have encountered this error message in the past seems to have
> resulted from a blank/empty level in a factor or an empty character.

Thanks.  That is useful.

I wasn't claiming that was no bug, just that it wasn't a limit on the file 
size.

 	-thomas

> For example:
>
>> library(foreign)
>> x <- data.frame(x=c("A", "B", "C"), y=c(1,2,3))
>> write.dta(x, file="temp.dta")
>> levels(x$x)[2]
> [1] "B"
>> levels(x$x)[2] <- ""
>> write.dta(x, file="temp.dta")
> Error in write.dta(x, file = "temp.dta") :
> 	a binary write error occurred
>
>
> My work-around at the time was to go through the data replacing ""
> with something else that I could then deal with later.
>
>
> -- 
> David Whiting
> University of Newcastle upon Tyne, UK
>

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list