Some theme
This commit is contained in:
parent
86390b609a
commit
f2cd5002e5
7 changed files with 24 additions and 4 deletions
8
R/hbar.R
8
R/hbar.R
|
|
@ -15,12 +15,13 @@
|
||||||
#' @param reverse Boolean indicating whether the color palette should be reversed
|
#' @param reverse Boolean indicating whether the color palette should be reversed
|
||||||
#' @param title Plot title. Default to empty string
|
#' @param title Plot title. Default to empty string
|
||||||
#' @param subtitle Plot subtitle. Default to empty string
|
#' @param subtitle Plot subtitle. Default to empty string
|
||||||
|
#' @param theme Some ggplot2 theme
|
||||||
#' @param ... Other arguments to be passed to "ggblanket::gg_col"
|
#' @param ... Other arguments to be passed to "ggblanket::gg_col"
|
||||||
#'
|
#'
|
||||||
#' @return A horizontal bar chart
|
#' @return A horizontal bar chart
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", ...){
|
hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", 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'"))
|
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'"))
|
||||||
|
|
@ -64,6 +65,7 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary"
|
||||||
stat = "identity",
|
stat = "identity",
|
||||||
title = "",
|
title = "",
|
||||||
subtitle = "",
|
subtitle = "",
|
||||||
|
theme = theme,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -89,12 +91,13 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary"
|
||||||
#' @param reverse Boolean indicating whether the color palette should be reversed
|
#' @param reverse Boolean indicating whether the color palette should be reversed
|
||||||
#' @param title Plot title. Default to empty string
|
#' @param title Plot title. Default to empty string
|
||||||
#' @param subtitle Plot subtitle. Default to empty string
|
#' @param subtitle Plot subtitle. Default to empty string
|
||||||
|
#' @param theme Some ggplot2 theme
|
||||||
#' @param ... Other arguments to be passed to "ggblanket::gg_col"
|
#' @param ... Other arguments to be passed to "ggblanket::gg_col"
|
||||||
#'
|
#'
|
||||||
#' @return A horizontal bar chart
|
#' @return A horizontal bar chart
|
||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", ...){
|
hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", position = "dodge", reverse = FALSE, title = "", subtitle = "", 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'"))
|
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'"))
|
||||||
|
|
@ -139,6 +142,7 @@ hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "
|
||||||
stat = "identity",
|
stat = "identity",
|
||||||
title = "",
|
title = "",
|
||||||
subtitle = "",
|
subtitle = "",
|
||||||
|
theme = theme,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ pandoc: 2.14.0.3
|
||||||
pkgdown: 2.0.5
|
pkgdown: 2.0.5
|
||||||
pkgdown_sha: ~
|
pkgdown_sha: ~
|
||||||
articles: {}
|
articles: {}
|
||||||
last_built: 2022-07-10T23:14Z
|
last_built: 2022-07-10T23:23Z
|
||||||
urls:
|
urls:
|
||||||
reference: https://gnoblet.github.io/visualizeR/reference
|
reference: https://gnoblet.github.io/visualizeR/reference
|
||||||
article: https://gnoblet.github.io/visualizeR/articles
|
article: https://gnoblet.github.io/visualizeR/articles
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||||
<span> title <span class="op">=</span> <span class="st">""</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> subtitle <span class="op">=</span> <span class="st">""</span>,</span>
|
||||||
|
<span> theme <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||||
<span> <span class="va">...</span></span>
|
<span> <span class="va">...</span></span>
|
||||||
<span><span class="op">)</span></span></code></pre></div>
|
<span><span class="op">)</span></span></code></pre></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -133,6 +134,10 @@
|
||||||
<dd><p>Plot subtitle. Default to empty string</p></dd>
|
<dd><p>Plot subtitle. Default to empty string</p></dd>
|
||||||
|
|
||||||
|
|
||||||
|
<dt>theme</dt>
|
||||||
|
<dd><p>Some ggplot2 theme</p></dd>
|
||||||
|
|
||||||
|
|
||||||
<dt>...</dt>
|
<dt>...</dt>
|
||||||
<dd><p>Other arguments to be passed to "ggblanket::gg_col"</p></dd>
|
<dd><p>Other arguments to be passed to "ggblanket::gg_col"</p></dd>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||||
<span> title <span class="op">=</span> <span class="st">""</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> subtitle <span class="op">=</span> <span class="st">""</span>,</span>
|
||||||
|
<span> theme <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||||
<span> <span class="va">...</span></span>
|
<span> <span class="va">...</span></span>
|
||||||
<span><span class="op">)</span></span></code></pre></div>
|
<span><span class="op">)</span></span></code></pre></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -133,6 +134,10 @@
|
||||||
<dd><p>Plot subtitle. Default to empty string</p></dd>
|
<dd><p>Plot subtitle. Default to empty string</p></dd>
|
||||||
|
|
||||||
|
|
||||||
|
<dt>theme</dt>
|
||||||
|
<dd><p>Some ggplot2 theme</p></dd>
|
||||||
|
|
||||||
|
|
||||||
<dt>...</dt>
|
<dt>...</dt>
|
||||||
<dd><p>Other arguments to be passed to "ggblanket::gg_col"</p></dd>
|
<dd><p>Other arguments to be passed to "ggblanket::gg_col"</p></dd>
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -20,6 +20,7 @@ hbar(
|
||||||
reverse = FALSE,
|
reverse = FALSE,
|
||||||
title = "",
|
title = "",
|
||||||
subtitle = "",
|
subtitle = "",
|
||||||
|
theme = NULL,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -54,6 +55,8 @@ hbar(
|
||||||
|
|
||||||
\item{subtitle}{Plot subtitle. Default to empty string}
|
\item{subtitle}{Plot subtitle. Default to empty string}
|
||||||
|
|
||||||
|
\item{theme}{Some ggplot2 theme}
|
||||||
|
|
||||||
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
|
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ hbar_percent(
|
||||||
reverse = FALSE,
|
reverse = FALSE,
|
||||||
title = "",
|
title = "",
|
||||||
subtitle = "",
|
subtitle = "",
|
||||||
|
theme = NULL,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -54,6 +55,8 @@ hbar_percent(
|
||||||
|
|
||||||
\item{subtitle}{Plot subtitle. Default to empty string}
|
\item{subtitle}{Plot subtitle. Default to empty string}
|
||||||
|
|
||||||
|
\item{theme}{Some ggplot2 theme}
|
||||||
|
|
||||||
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
|
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
|
||||||
}
|
}
|
||||||
\value{
|
\value{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue