You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a a stacked area graph, it requires an entry at every x for every group. If for a given x value, one group doesn't have an entry in the data frame, then it will behave as though the y value of that group at that x is zero.
The pictures will illustrate better:
dat<-data.frame(
g=rep(LETTERS[1:3], each=4),
x=rep(1:4, 3),
y=rep(3:14))
# Remove row with g=B, x=3 dat<-dat[-7,]
dat# Lines all look straight
ggplot(dat, aes(x=x, y=y, colour=g)) + geom_line()
# With a stacked area graph, there's a dip at x=3
ggplot(dat, aes(x=x, y=y, fill=g)) + geom_area()
I think fixing this one would require doing some interpolation. Perhaps solving this one is better left to the large changes to stacking code in the future?
The text was updated successfully, but these errors were encountered:
Just a note, although this is useful in some cases, I don't think this kind of automatic interpolation is good idea.
The purpose of visualization is to visually inspect how the data is.
But the automatic interpolation will make users miss the missing values.
Furthermore, there is no reason to apply liner interpolation. Why not smoothing, why not other filtering?
So, in my view, interpolation should be done by users' hand.
Or, at least, the explicit way, such as stat_interpolate, should be provided. But maybe this is beyond the scope of "plotting."
Another way is to simply induce an error or a warning when missing values are detected.
Yeah, I'm totally with @KOSHKE on this one. It gets even more complicated if you consider longitudinal data where possibly none of the time points align.
But I think it's worth having some tool that will do this, just not automatically. Something to consider for 1.0
That makes sense. I think it would be a good idea to have an informative warning message so that people know how to deal with the issue if they encounter it.
This sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette.
With a a stacked area graph, it requires an entry at every x for every group. If for a given x value, one group doesn't have an entry in the data frame, then it will behave as though the y value of that group at that x is zero.
The pictures will illustrate better:
Test code:
I think fixing this one would require doing some interpolation. Perhaps solving this one is better left to the large changes to stacking code in the future?
The text was updated successfully, but these errors were encountered: