rubenarslan / codebook

Cook rmarkdown codebooks from metadata on R data frames
https://rubenarslan.github.io/codebook/
Other
142 stars 16 forks source link

Failure with dev purrr #73

Closed hadley closed 1 month ago

hadley commented 2 years ago

With the dev version of purrr, the following code fails:

library(codebook)

num <- haven::read_spss(test_path("different-missings.sav"), user_na = TRUE)
attributes(num[, 3][[1]])$na_values <- NULL
attributes(num[, 3][[1]])$label <- ""
attributes(num[, 4][[1]])$label <- ""

num <- detect_missing(num,
  negative_values_are_missing = FALSE,
  only_labelled = FALSE,
  use_labelled_spss = TRUE
)

num <- detect_missing(num,
  negative_values_are_missing = TRUE,
  only_labelled = FALSE
)

I've tried to dig a bit into detect_missing() but I can't figure out if it's something wrong in the first or second call to detect_missing(). I'm happy to dig in a bit further, but I really need some help from you.

rubenarslan commented 1 month ago

Sorry for the extremely late response. I cannot reproduce the error with purrr 1.0.2 and the output is correct. Not sure what was up, so I'm closing this issue.