When I use geom_area() , I expect it to be very similar to geom_bar() , but I am a bit perplexed by this behavior for missing values.
require(dplyr) require(ggplot2) set.seed(1) test <- data.frame(x=rep(1:10,3), y=abs(rnorm(30)), z=rep(LETTERS[1:3],10)) %>% arrange(x,z) # I also have no idea why geom_area needs the data.frame to be sorted first. test[test$x==4,"y"] <- NA ggplot(test, aes(x, y, fill=z)) + geom_bar(stat="identity", position="stack")
Produces this glass histogram. 
However, if I go to stack_area (), it interpolates for missing values.
> ggplot(test, aes(x, y, fill=z)) + geom_area(stat="identity", position="stack") Warning message: Removed 3 rows containing missing values (position_stack).

If I add na.rm=FALSE or na.rm=TRUE , it does not matter.
ggplot (test, aes (x, y, fill = z)) + geom_area (stat = "identity", position = "stack", na.rm = TRUE) Warning message: 3 lines containing missing values ββwere deleted (position_stack)

ggplot (test, aes (x, y, fill = z)) + geom_area (stat = "identity", position = "stack", na.rm = FALSE) Warning message: 3 lines containing missing values ββ(position_stack) were deleted.

Obviously, everything I'm trying does not work. How can I show space in series with stack_area() ?