You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have imported an SPSS .sav file into R using haven::read_sav and have noticed that long variable labels get truncated (to between around 100-140 characters).
I seem to be unable to read the entire original variable labels as they appeared in SPSS. This is the case whether I use var_label(data$variable), attr(data$variable, "label"), or str(data$label). Using the latter command returns __truncated__ following the label character.
The same thing happens when I import the .sav file into Python using pyreadstat and pandas.read_spss
Do you know if there is a maximum character limit on Haven/ReadStat when importing variable labels from .sav files into R or Python? Is there a way to read these that is not truncated?
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered:
Since this behaviour is the same in pyreadstat it's most likely something to do with the ReadStat code that reads variable labels rather than a haven specific thing, but I'll check it out.
Thank you for writing such a great package!
I have imported an SPSS
.sav
file into R usinghaven::read_sav
and have noticed that long variable labels get truncated (to between around 100-140 characters).I seem to be unable to read the entire original variable labels as they appeared in SPSS. This is the case whether I use
var_label(data$variable)
,attr(data$variable, "label")
, orstr(data$label)
. Using the latter command returns__truncated__
following the label character.The same thing happens when I import the
.sav
file into Python usingpyreadstat
andpandas.read_spss
Do you know if there is a maximum character limit on Haven/ReadStat when importing variable labels from
.sav
files into R or Python? Is there a way to read these that is not truncated?Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: