Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vis_dat do not render empty lists as missing values within list columns #136

Closed
cregouby opened this issue Sep 11, 2021 · 0 comments · Fixed by #138
Closed

vis_dat do not render empty lists as missing values within list columns #136

cregouby opened this issue Sep 11, 2021 · 0 comments · Fixed by #138

Comments

@cregouby
Copy link
Contributor

cregouby commented Sep 11, 2021

Missing values in list columns are not shown missing in vis_dat

ReprEx

in the example dataset starwars, two list columns vehicles and starship contains a lot of missing values.
Those missing values can be identified as character vectors of length 0 as follow
This is very misleading in the vis_dat output visualization as it let you think those columns are complete.

library(dplyr, warn.conflicts = FALSE)
data("starwars")
head(starwars %>% select(vehicles, starships))
#> # A tibble: 6 × 2
#>   vehicles  starships
#>   <list>    <list>   
#> 1 <chr [2]> <chr [2]>
#> 2 <chr [0]> <chr [0]>
#> 3 <chr [0]> <chr [0]>
#> 4 <chr [0]> <chr [1]>
#> 5 <chr [1]> <chr [0]>
#> 6 <chr [0]> <chr [0]>

Created on 2021-09-11 by the reprex package (v2.0.1)

Current behaviour

library(visdat)
data("starwars",package = "dplyr")
vis_dat(starwars)

Created on 2021-09-11 by the reprex package (v2.0.1)

Expected behavior

library(visdat)
data("starwars",package = "dplyr")
vis_dat(starwars)

Created on 2021-09-11 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant