Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning full variable labels #731

Open
carecodeconnect opened this issue Aug 22, 2023 · 1 comment
Open

Returning full variable labels #731

carecodeconnect opened this issue Aug 22, 2023 · 1 comment
Labels

Comments

@carecodeconnect
Copy link

Thank you for writing such a great package!

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!

@gorcha
Copy link
Member

gorcha commented Aug 28, 2023

Hi @carecodeconnect, thanks for the report.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants