NA handling: methods for missing data

194 views
Skip to first unread message

Nicholas Lewin-Koh

unread,
Sep 8, 2009, 12:47:30 PM9/8/09
to ggp...@googlegroups.com, Sock Cheng
Hi Hadley,
After searching through the documentation, we realized that the default
handling of NA's
in ggplot2 is "na.omit". It would be nice if there were some ways to
handle them differently
in ggplot. Something like
p <- ggplot(mtcars, aes(mpg, wt, colour = cyl)) + geom_point()
p + NA_geom_rug(aes(mpg,wt))

Or something like that, where NAs could be handled explicitly. This is
probably possible by just doing separate layers for each axis, but
explicit methods
would be nice. Perhaps this is time for me to roll up my sleeves and
submit
something to ggplot extra.

Nicholas

hadley wickham

unread,
Sep 12, 2009, 11:37:24 AM9/12/09
to Nicholas Lewin-Koh, ggp...@googlegroups.com, Sock Cheng
Hi Nicholas,

It varies a little bit - for categorical scales, missings will always
be included as one of the categories. There's no equivalent for
continuous scales. I've thought about a scale that is a combination
of continuous and categorical, but it would be a lot of work.

Hadley
--
http://had.co.nz/
Reply all
Reply to author
Forward
0 new messages