From 84d91521da54e5c39fa2ab561c62b57688bd278b Mon Sep 17 00:00:00 2001 From: "Zhian N. Kamvar" Date: Thu, 7 May 2020 17:40:22 -0700 Subject: [PATCH] revert to tally; bump version a bug in dplyr was fixed: --- DESCRIPTION | 2 +- NEWS.md | 8 ++++++++ R/age-pyramid.R | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c33fbcb..f3fbaf8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: apyramid Title: Visualize Population Pyramids Aggregated by Age -Version: 0.1.1 +Version: 0.1.2 Authors@R: c( person(given = "Zhian N.", family = "Kamvar", diff --git a/NEWS.md b/NEWS.md index a70a90c..b044b3c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# apyramid 0.1.2 + +CRAN MAINTENANCE +---------------- + +* This version has no user-visible changes and fixes a couple of changed + behaviors that arose because of dplyr version 1.0.0. (#6, #7, @zkamvar). + # apyramid 0.1.1 CRAN MAINTENANCE diff --git a/R/age-pyramid.R b/R/age-pyramid.R index 0c73532..03e7cf1 100644 --- a/R/age-pyramid.R +++ b/R/age-pyramid.R @@ -212,7 +212,7 @@ age_pyramid <- function(data, age_group = "age_group", split_by = "sex", } # find the maximum x axis position - maxdata <- dplyr::summarize(maxdata, n := sum(!!quote(n))) + maxdata <- dplyr::tally(maxdata, wt = !!quote(n), name = "n") max_n <- max(abs(maxdata[["n"]]), na.rm = TRUE) if (proportional) {