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.