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

Missing values #24

Closed
earowang opened this issue Jan 28, 2021 · 2 comments
Closed

Missing values #24

earowang opened this issue Jan 28, 2021 · 2 comments

Comments

@earowang
Copy link
Collaborator

earowang commented Jan 28, 2021

Shall we handle missing values as is now? or different?

library(dplyr)
movies <- jsonlite::read_json(
  "https://vega.github.io/vega-editor/app/data/movies.json"
  , simplifyVector = TRUE)
movies <- movies %>%
  mutate(missing = is.na(IMDB_Rating) | is.na(Rotten_Tomatoes_Rating))
movies %>%
  vega(enc(IMDB_Rating, Rotten_Tomatoes_Rating, colour = missing)) %>%
  mark_point() %>%
  config(mark = list(invalid = NULL))
@sa-lee
Copy link
Collaborator

sa-lee commented Jan 29, 2021

The default is to filter, which I think is reasonable.
Another problem happens in the json serialisation when we create the spec from vegawdiget.
Here's the example from #27, the current serialisation doesn't include the body mass column because it's NA in R:

Screen Shot 2021-01-29 at 11 01 21 am

because it isn't explicit vega gives NaNs for the density estimate for adelie / gentoo.
If we change that to an explicit null for adelie it's area pops up

Screen Shot 2021-01-29 at 11 01 04 am

@earowang
Copy link
Collaborator Author

A new argument na.rm = TRUE gives a warning about missing values are present in makr_*().

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

No branches or pull requests

2 participants