Harmonize na_values in haven_labelled_spss

harmonize_na_values(df)

Arguments

df

A data frame that contains haven_labelled_spss vectors.

Value

A tibble where the na_values are consistent

See also

Examples

# \donttest{ examples_dir <- system.file( "examples", package = "retroharmonize" ) test_read <- read_rds ( file.path(examples_dir, "ZA7576.rds"), id = "ZA7576", doi = "test_doi") harmonize_na_values(test_read)
#> # A tibble: 45 x 56 #> rowid doi version uniqid caseid serialid isocntry p1 p2 p3 #> <chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> <dbl+lb> <dbl+l> <dbl> #> 1 ZA75~ doi:~ 1.0.0 ~ 5.00e7 481 3209 ES 4 [Mon~ 3 [13 ~ 25 #> 2 ZA75~ doi:~ 1.0.0 ~ 1.10e8 76 8706 NL 6 [Wed~ 3 [13 ~ 58 #> 3 ZA75~ doi:~ 1.0.0 ~ 1.10e8 343 8890 NL 11 [Mon~ 3 [13 ~ 56 #> 4 ZA75~ doi:~ 1.0.0 ~ 1.10e8 473 8989 NL 5 [Tue~ 3 [13 ~ 62 #> 5 ZA75~ doi:~ 1.0.0 ~ 1.10e8 493 9001 NL 8 [Fri~ 4 [17 ~ 30 #> 6 ZA75~ doi:~ 1.0.0 ~ 1.10e8 897 9272 NL 6 [Wed~ 3 [13 ~ 56 #> 7 ZA75~ doi:~ 1.0.0 ~ 1.10e8 1041 9379 NL 5 [Tue~ 3 [13 ~ 57 #> 8 ZA75~ doi:~ 1.0.0 ~ 1.10e8 1192 9493 NL 6 [Wed~ 2 [8 -~ 60 #> 9 ZA75~ doi:~ 1.0.0 ~ 1.10e8 1274 9543 NL 7 [Thu~ 4 [17 ~ 57 #> 10 ZA75~ doi:~ 1.0.0 ~ 1.10e8 1344 9590 NL 6 [Wed~ 2 [8 -~ 83 #> # ... with 35 more rows, and 46 more variables: p4 <dbl+lbl>, p5 <dbl+lbl>, #> # nuts <chr+lbl>, d7 <dbl+lbl>, d8 <dbl+lbl>, d25 <dbl+lbl>, d60 <dbl+lbl>, #> # qa14_5 <dbl+lbl>, qa14_3 <dbl+lbl>, qa14_2 <dbl+lbl>, qa14_4 <dbl+lbl>, #> # qa14_1 <dbl+lbl>, qa6a_5 <dbl+lbl>, qa6a_10 <dbl+lbl>, qa6b_2 <dbl+lbl>, #> # qa6a_3 <dbl+lbl>, qa6a_1 <dbl+lbl>, qa6b_4 <dbl+lbl>, qa6a_8 <dbl+lbl>, #> # qa6a_9 <dbl+lbl>, qa6a_4 <dbl+lbl>, qa6a_2 <dbl+lbl>, qa6b_1 <dbl+lbl>, #> # qa6a_6 <dbl+lbl>, qa6a_7 <dbl+lbl>, qa6a_11 <dbl+lbl>, qa6b_3 <dbl+lbl>, #> # qd6.1 <dbl+lbl>, qd6.2 <dbl+lbl>, qd6.3 <dbl+lbl>, qd6.4 <dbl+lbl>, #> # qd6.5 <dbl+lbl>, qd6.6 <dbl+lbl>, qd6.7 <dbl+lbl>, qd6.8 <dbl+lbl>, #> # qd6.9 <dbl+lbl>, qd6.10 <dbl+lbl>, qd6.11 <dbl+lbl>, qd6.12 <dbl+lbl>, #> # qd6.13 <dbl+lbl>, qd6.14 <dbl+lbl>, qg1b <dbl+lbl>, qg8 <dbl+lbl>, #> # w1 <dbl>, w3 <dbl>, wex <dbl>
# }