Skip to content

time column in spss is different from time column of the same file imported in R #64

@reyntjesr

Description

@reyntjesr

I have a spss file with a time column called "tijdstartklin". When I view this file in spss, rows 11 and 14 (subject 15 and 19) have the times 0:23:48 and 0:29:35.
When I import the spss file with the command:

SpNm=haven::read_spss('example.sav') %>% mutate(parsed=hms::parse_hms(tijdstartklin))

The "tijdstartklin" fields of subjects 15 and 19 are now 00:23:471 and 00:29:341 and in the "parsed" column the times are 00:23:00 and 00:29:00.

Is this an error in the spss file or does haven import the column incorrectly?

example.zip

spss version 23

sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Dutch_Netherlands.1252 LC_CTYPE=Dutch_Netherlands.1252 LC_MONETARY=Dutch_Netherlands.1252
[4] LC_NUMERIC=C LC_TIME=Dutch_Netherlands.1252

attached base packages:
[1] stats graphics grDevices datasets utils methods base

other attached packages:
[1] haven_1.1.2 ggplot2_3.0.0 dplyr_0.7.6

loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 rstudioapi_0.7 bindr_0.1.1 magrittr_1.5 hms_0.4.2 tidyselect_0.2.4 munsell_0.5.0
[8] colorspace_1.3-2 R6_2.2.2 rlang_0.2.1 plyr_1.8.4 tools_3.5.0 grid_3.5.0 gtable_0.2.0
[15] withr_2.1.2 yaml_2.2.0 lazyeval_0.2.1 assertthat_0.2.0 tibble_1.4.2 crayon_1.3.4 bindrcpp_0.2.2
[22] purrr_0.2.5 glue_1.3.0 compiler_3.5.0 pillar_1.3.0 forcats_0.3.0 scales_0.5.0 pkgconfig_2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions