agstn / dataxray

An interactive table interface for data summaries

Home Page:https://agstn.github.io/dataxray/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dataxray doesn't play nice with haven imported data with labels

ifellows opened this issue · comments

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.