haven
haven copied to clipboard
Haven: The file's timestamp string is invalid
I try to read SPSS format:
dataframe <- as.data.frame(read_sav("C:/~FilePath/Dataset.sav"))
and get:
Error in df_parse_sav_file(spec, encoding, user_na, cols_skip, n_max, : Failed to parse ~FilePath/Dataset: The file's timestamp string is invalid.
This has been posted in a closed issue (The file's timestamp string is invalid #488) and in a Stackoverflow question [(Difficulty with haven package Reading SPSS data in R)](https://stackoverflow.com/questions/60006760/difficulty-with-haven-package-reading-spss-data-in-r), but I have not found any solution yet.
HI @AlejandroDGR, thanks for the bug report.
Are you able to share a copy of the file causing the issue so we can investigate?
Of course @gorcha!
It happens to me with several files. All of them come from the Spanish National Sociological Centre, like this example
Luckily, they're a minority (the great majority of Spanish National Sociological Centre's files work fine).
Perfect, thanks!
@evanmiller this is related to #488, but for SPSS files rather than Stata. The fix provided for #488 ignores invalid timestamps rather than throwing an error but only for Stata files, so an invalid timestamp will still throw an error in an SPSS file. I think the SPSS timestamp parsing code just needs to continue on failure like the Stata code?
I'm having this issue as well for a file from the same origin as @AlejandroDGR's. I'm wondering if the issue has been resolved as the problem appeared to have been identified and fixed for Stata files. @gorcha
Hi @JulianEGerez,
We're waiting for PR WizardMac/ReadStat#277 to be merged in the underlying ReadStat library to resolve this. I've followed up with the maintainer over there, hopefully won't be too long.