write xpt file with error of provided tag value out of range

Hi everyone, I was trying to write a xpt file from RStudio with haven package. A weird issue happened: " Error: Failed to insert value [1, 66]: A provided tag value was outside the range of allowed values in the specified file format."
I printed out [1,66]:

demog[1,66]
[1] NA
Here are all values from column 66:
demog[,66]
[1] NA 7 93 NA 0 50 0 0 0 NA NA 0 NA NA NA 0 NA NA 98 NA 0 0 12 0 0
[26] 0 0 NA 35 0 0 0 0 0 0 70 0 0 0 NA 0 0 0 0 NA 96 0 0 0 98
[51] NA 0 0 NA 0 NA NA NA NA NA

So, here is my question, what's the provided tag value? Why "NA" is out of range? Note: column 66 is numeric.

Any solutions or suggestions will be very welcome. Thanks.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.