Closed rabergj closed 1 year ago
@rabergj fixed in version 0.2.1, please test the new remove_na
parameter, e.g.
library(ggstackplot)
library(dplyr)
# default
mtcars |>
add_row(mpg = 22, wt = 5, qsec = NA) |>
ggstackplot(
x = mpg, y = c(wt, qsec),
color = c("#E41A1C", "#377EB8")
)
# explicit `remove_na` = FALSE
mtcars |>
add_row(mpg = 22, wt = 5, qsec = NA) |>
ggstackplot(
x = mpg, y = c(wt, qsec),
color = c("#E41A1C", "#377EB8"),
remove_na = FALSE
)
#> Warning: There was 1 warning in `dplyr::mutate()`.
#> ℹ In argument: `gtable = map(.data$plot_w_theme, ggplot2::ggplotGrob)`.
#> Caused by warning:
#> ! Removed 1 rows containing missing values (`geom_point()`).
Line breaks appear when a given x value doesn't have a corresponding y value for each variable.
Came across this when playing with my own data. Since the x values (Age) are generally different for different proxy records, this generates a lot of unwanted line breaks.