From d027e265bf265125cd0e8c0e48fddbcaf5253d9f Mon Sep 17 00:00:00 2001 From: Joseph Larmarange Date: Wed, 21 Aug 2024 19:42:39 +0200 Subject: [PATCH] remove width --- R/geom_bar_diverging.R | 19 ++++++------------- man/geom_bar_diverging.Rd | 20 ++++++-------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/R/geom_bar_diverging.R b/R/geom_bar_diverging.R index b4b98c7..66ac079 100644 --- a/R/geom_bar_diverging.R +++ b/R/geom_bar_diverging.R @@ -29,7 +29,6 @@ #' @param labeller Labeller function to format labels, #' see [`stat_prop()`]. Passed only if `stat = "prop"`. #' @inheritParams position_likert -#' @param width Bar width. #' @export #' @examples #' library(ggplot2) @@ -71,8 +70,7 @@ geom_bar_diverging <- function(mapping = NULL, height = "count", reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL) { + cutoff = NULL) { args <- list(...) if (stat == "prop") { @@ -104,8 +102,7 @@ geom_bar_likert <- function(mapping = NULL, height = "prop", reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL) { + cutoff = NULL) { args <- c(as.list(environment()), list(...)) do.call(geom_bar_diverging, args) @@ -127,8 +124,7 @@ geom_bar_pyramid <- function(mapping = NULL, height = "prop", reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = 1) { + cutoff = NULL) { args <- c(as.list(environment()), list(...)) do.call(geom_bar_diverging, args) @@ -153,8 +149,7 @@ geom_text_diverging <- function(mapping = NULL, labeller = label_number_abs(), reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL) { + cutoff = NULL) { args <- list(...) if (stat == "prop") { @@ -191,8 +186,7 @@ geom_text_likert <- function(mapping = NULL, labeller = label_percent_abs(accuracy = 1), reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL) { + cutoff = NULL) { args <- c(as.list(environment()), list(...)) do.call(geom_text_diverging, args) @@ -217,8 +211,7 @@ geom_text_pyramid <- function(mapping = NULL, labeller = label_percent_abs(accuracy = 1), reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = 1) { + cutoff = NULL) { args <- c(as.list(environment()), list(...)) do.call(geom_text_diverging, args) diff --git a/man/geom_bar_diverging.Rd b/man/geom_bar_diverging.Rd index 644982e..68e00b8 100644 --- a/man/geom_bar_diverging.Rd +++ b/man/geom_bar_diverging.Rd @@ -21,8 +21,7 @@ geom_bar_diverging( height = "count", reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL + cutoff = NULL ) geom_bar_likert( @@ -37,8 +36,7 @@ geom_bar_likert( height = "prop", reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL + cutoff = NULL ) geom_bar_pyramid( @@ -53,8 +51,7 @@ geom_bar_pyramid( height = "prop", reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = 1 + cutoff = NULL ) geom_text_diverging( @@ -71,8 +68,7 @@ geom_text_diverging( labeller = label_number_abs(), reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL + cutoff = NULL ) geom_text_likert( @@ -89,8 +85,7 @@ geom_text_likert( labeller = label_percent_abs(accuracy = 1), reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = NULL + cutoff = NULL ) geom_text_pyramid( @@ -107,8 +102,7 @@ geom_text_pyramid( labeller = label_percent_abs(accuracy = 1), reverse = FALSE, exclude_fill_values = NULL, - cutoff = NULL, - width = 1 + cutoff = NULL ) } \arguments{ @@ -146,8 +140,6 @@ negatively the two first categories and a fifth of the third (see examples). By default (\code{NULL}), it will be equal to the number of categories divided by 2, i.e. it will be centered.} -\item{width}{Bar width.} - \item{labels}{Statistic used, by default, to determine the labels, see \code{\link[=stat_prop]{stat_prop()}}. Passed only if \code{stat = "prop"}.}