Change theme arg name

This commit is contained in:
gnoblet 2022-07-17 19:25:09 -04:00
parent 0088a1ad65
commit 106fddc8ea
7 changed files with 16 additions and 16 deletions

View file

@ -15,13 +15,13 @@
#' @param reverse Boolean indicating whether the color palette should be reversed
#' @param title Plot title. Default to empty string
#' @param subtitle Plot subtitle. Default to empty string
#' @param theme Some ggplot2 theme
#' @param gg_theme Some ggplot2 theme
#' @param ... Other arguments to be passed to "ggblanket::gg_col"
#'
#' @return A horizontal bar chart
#'
#' @export
hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", theme = NULL, ...){
hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", gg_theme = NULL, ...){
if (!(initiative %in% c("reach", "agora", "impact"))) rlang::abort(c("Wrong `initiative` arg", "*" = paste0("Arg `initiative` cannot be: ", initiative), "i" = "It must be one of 'reach' or 'agora' or 'impact'"))
@ -65,7 +65,7 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "prim
stat = "identity",
title = "",
subtitle = "",
theme = theme,
theme = gg_theme,
...
)
@ -91,13 +91,13 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "prim
#' @param reverse Boolean indicating whether the color palette should be reversed
#' @param title Plot title. Default to empty string
#' @param subtitle Plot subtitle. Default to empty string
#' @param theme Some ggplot2 theme
#' @param gg_theme Some ggplot2 theme
#' @param ... Other arguments to be passed to "ggblanket::gg_col"
#'
#' @return A horizontal bar chart
#'
#' @export
hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", theme = NULL, ...){
hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", palette = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", gg_theme = NULL, ...){
if (!(initiative %in% c("reach", "agora", "impact"))) rlang::abort(c("Wrong `initiative` arg", "*" = paste0("Arg `initiative` cannot be: ", initiative), "i" = "It must be one of 'reach' or 'agora' or 'impact'"))
@ -142,7 +142,7 @@ hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", palette
stat = "identity",
title = "",
subtitle = "",
theme = theme,
theme = gg_theme,
...
)