From 21b03712ce33a55651d6f5b77957464b6931f3b9 Mon Sep 17 00:00:00 2001 From: corybrunson Date: Thu, 28 Nov 2019 05:17:51 -0500 Subject: [PATCH] debug alluvia form neg obs + version patch --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ inst/examples/ex-stat-flow.r | 11 +++++++++++ man/stat_flow.Rd | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e6a61d9d..230f9cc4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ggalluvial Type: Package Title: Alluvial Plots in 'ggplot2' -Version: 0.11.0.0001 +Version: 0.11.1 Date: 2019-11-25 Authors@R: person('Jason Cory', 'Brunson', email = 'cornelioid@gmail.com', role = c('aut', 'cre')) diff --git a/NEWS.md b/NEWS.md index 09dccf3b..99f5b0d9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,10 @@ # next version (v1.0.0?) +# ggalluvial 0.11.1 + +This patch fixes a bug with including negative observations in alluvia-form data due to outdated code that prohibited negative `y` values. This was discovered while drafting two examples of this usage, which are included in the documentation. + # ggalluvial 0.11.0 ## Parameter renamings, deprecations, and additions diff --git a/inst/examples/ex-stat-flow.r b/inst/examples/ex-stat-flow.r index 0a7f2f80..658dfc8c 100644 --- a/inst/examples/ex-stat-flow.r +++ b/inst/examples/ex-stat-flow.r @@ -45,6 +45,17 @@ ggplot(vaccinations, stat_stratum(alpha = .5) + geom_flow(max.y = 100) + geom_text(stat = "stratum") +# negate missing entries +ggplot(transform(vaccinations, count = freq * (-1) ^ (response == "Missing")), + aes(y = count, + x = survey, stratum = response, alluvium = subject, + fill = response, label = response, + alpha = response != "Missing")) + + stat_stratum() + + geom_flow() + + geom_text(stat = "stratum", alpha = 1) + + scale_alpha_discrete(range = c(.2, .6)) + + guides(alpha = FALSE) # aesthetics that vary betwween and within strata data(vaccinations) diff --git a/man/stat_flow.Rd b/man/stat_flow.Rd index ab318770..4b986dd9 100644 --- a/man/stat_flow.Rd +++ b/man/stat_flow.Rd @@ -234,6 +234,17 @@ ggplot(vaccinations, stat_stratum(alpha = .5) + geom_flow(max.y = 100) + geom_text(stat = "stratum") +# negate missing entries +ggplot(transform(vaccinations, count = freq * (-1) ^ (response == "Missing")), + aes(y = count, + x = survey, stratum = response, alluvium = subject, + fill = response, label = response, + alpha = response != "Missing")) + + stat_stratum() + + geom_flow() + + geom_text(stat = "stratum", alpha = 1) + + scale_alpha_discrete(range = c(.2, .6)) + + guides(alpha = FALSE) # aesthetics that vary betwween and within strata data(vaccinations)