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

read_sav trims longstrings #381

Closed
JanMarvin opened this issue Jun 14, 2018 · 4 comments
Closed

read_sav trims longstrings #381

JanMarvin opened this issue Jun 14, 2018 · 4 comments

Comments

@JanMarvin
Copy link

@JanMarvin JanMarvin commented Jun 14, 2018

read_sav does not return the full length of long strings as can be shown using a pspp example sav-file.

haven 1.1.1

library(haven)

fl <- tempfile()
url <- "https://github.com/ideitegia/pspp/raw/master/tests/data/v13.sav"
download.file(url, fl)

df_h <- read_sav(fl)

nchar(df_h$A2000) # 265 265 should be 2000 each
@JanMarvin
Copy link
Author

@JanMarvin JanMarvin commented Jun 14, 2018

Same issue different file:

library(haven)

fl <- tempfile()
url <- "https://github.com/ideitegia/pspp/raw/master/tests/data/v14.sav"
download.file(url, fl)

df_h <- read_sav(fl)

nchar(df_h) # 255 256 1335 1337

@hadley
Copy link
Member

@hadley hadley commented Jun 20, 2018

@evanmiller could you please take a look?

@hadley
Copy link
Member

@hadley hadley commented Jan 23, 2019

Looks like this is now fixed:

library(haven)

fl <- tempfile()
url <- "https://github.com/ideitegia/pspp/raw/master/tests/data/v14.sav"
download.file(url, fl)

df_h <- read_sav(fl)
nchar(df_h)
#>  vl255  vl256 vl1335 vl2000 
#>    255    256   1335   2000

Created on 2019-01-23 by the reprex package (v0.2.1.9000)

@hadley hadley closed this in 560a596 Jan 23, 2019
@lock
Copy link

@lock lock bot commented Jul 22, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants