dataxray doesn't play nice with haven imported data with labels
ifellows opened this issue · comments
Ian Fellows commented
Just discovered the package. I got the following error on the first dataset I tried it on. It looks like the HMisc::describe
call in make_xray_core
should coerce the input into either a factor or numeric.
> data.frame(a=1:3,b=haven::labelled(c(1, 1, 2), c(Male = 1, Female = 2))) %>% dataxray::make_xray()
Error in `mutate()`:
! Problem while computing `describe = ... %>% list()`.
ℹ The error occurred in row 2.
Caused by error in `proxy[, ..., drop = FALSE]`:
! incorrect number of dimensions
Run `rlang::last_error()` to see where the error occurred.
Warning message:
Problem while computing `describe = ... %>% list()`.
ℹ 'length(x) = 2 > 1' in coercion to 'logical(1)'
ℹ The warning occurred in row 2.