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,
...
)

View file

@ -2,7 +2,7 @@ pandoc: 2.17.1.1
pkgdown: 2.0.5
pkgdown_sha: ~
articles: {}
last_built: 2022-07-17T23:19Z
last_built: 2022-07-17T23:24Z
urls:
reference: https://gnoblet.github.io/visualizeR/reference
article: https://gnoblet.github.io/visualizeR/articles

View file

@ -67,7 +67,7 @@
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> title <span class="op">=</span> <span class="st">""</span>,</span>
<span> subtitle <span class="op">=</span> <span class="st">""</span>,</span>
<span> theme <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> gg_theme <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
</div>
@ -134,7 +134,7 @@
<dd><p>Plot subtitle. Default to empty string</p></dd>
<dt>theme</dt>
<dt>gg_theme</dt>
<dd><p>Some ggplot2 theme</p></dd>

View file

@ -67,7 +67,7 @@
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span> title <span class="op">=</span> <span class="st">""</span>,</span>
<span> subtitle <span class="op">=</span> <span class="st">""</span>,</span>
<span> theme <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> gg_theme <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
</div>
@ -134,7 +134,7 @@
<dd><p>Plot subtitle. Default to empty string</p></dd>
<dt>theme</dt>
<dt>gg_theme</dt>
<dd><p>Some ggplot2 theme</p></dd>

File diff suppressed because one or more lines are too long

View file

@ -20,7 +20,7 @@ hbar(
reverse = FALSE,
title = "",
subtitle = "",
theme = NULL,
gg_theme = NULL,
...
)
}
@ -55,7 +55,7 @@ hbar(
\item{subtitle}{Plot subtitle. Default to empty string}
\item{theme}{Some ggplot2 theme}
\item{gg_theme}{Some ggplot2 theme}
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
}

View file

@ -20,7 +20,7 @@ hbar_percent(
reverse = FALSE,
title = "",
subtitle = "",
theme = NULL,
gg_theme = NULL,
...
)
}
@ -55,7 +55,7 @@ hbar_percent(
\item{subtitle}{Plot subtitle. Default to empty string}
\item{theme}{Some ggplot2 theme}
\item{gg_theme}{Some ggplot2 theme}
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
}