Missing values
earowang opened this issue · 2 comments
earowang commented
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 commented
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:
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
earowang commented
A new argument na.rm = TRUE
gives a warning about missing values are present in makr_*()
.