Displaying 1 result from an estimated 1 matches for "var208".
Did you mean:
var20
2009 Mar 25
2
[ggplot2] Densityplot, grouping and NAs
Dear all,
I do not fully understand how ggplot2 handles NAs. See the following
example:
library(ggplot2)
x <- rnorm(150)
g <- as.factor(c(rep(c(0,1,NA),50)))
mydf <- data.frame(x,g)
m <- ggplot(aes(x = x, group = g, color = g), data = mydf)
m + geom_density()
How do I get rid of the NAs (i.e. the blue colored curve)?
I thought
## m <- ggplot(aes(x = x, group = g, color = g,