Some change / some test

This commit is contained in:
gnoblet 2022-07-10 19:17:44 -04:00
parent bdee722ce1
commit 86390b609a
7 changed files with 4 additions and 60 deletions

View file

@ -11,19 +11,16 @@
#' @param y_title The y scale title. Default to empty string
#' @param group_title The group legend title. Defaut to NULL
#' @param font_family The font family. Default to "Leelawadee"
#' @param font_size Body font size; default to 12
#' @param position Should the chart be stacked? Default to dodge
#' @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 title_font_size Default to 16
#' @param subtitle_font_size Default to 14
#' @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", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", font_size = 12, position = "dodge", reverse = FALSE, title = "", subtitle = "", title_font_size = 16, subtitle_font_size = 14, ...){
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 = "", ...){
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'"))
@ -57,7 +54,6 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary"
ggblanket::gg_col(x = {{ x }},
y = {{ y }},
col = {{ group }},
theme = ggblanket::gg_theme(font = font_family, pal_title = main_col),
x_title = x_title,
y_title = y_title,
col_title = group_title,
@ -89,19 +85,16 @@ hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary"
#' @param y_title The y scale title. Default to empty string
#' @param group_title The group legend title. Defaut to NULL
#' @param font_family The font family. Default to "Leelawadee"
#' @param font_size Body font size; default to 12
#' @param position Should the chart be stacked? Default to dodge
#' @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 title_font_size Default to 16
#' @param subtitle_font_size Default to 14
#' @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", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", font_size = 12, position = "dodge", reverse = FALSE, title = "", subtitle = "", title_font_size = 16, subtitle_font_size = 14, ...){
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 = "", ...){
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'"))
@ -135,7 +128,6 @@ hbar_percent <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "
ggblanket::gg_col(x = {{ x }},
y = {{ y }},
col = {{ group }},
theme = ggblanket::gg_theme(font = font_family, pal_title = main_col, size_body = font_size, size_title = title_font_size, size_subtitle = subtitle_font_size),
x_title = x_title,
y_title = y_title,
col_title = group_title,

View file

@ -2,7 +2,7 @@ pandoc: 2.14.0.3
pkgdown: 2.0.5
pkgdown_sha: ~
articles: {}
last_built: 2022-07-10T22:59Z
last_built: 2022-07-10T23:14Z
urls:
reference: https://gnoblet.github.io/visualizeR/reference
article: https://gnoblet.github.io/visualizeR/articles

View file

@ -63,13 +63,10 @@
<span> y_title <span class="op">=</span> <span class="st">""</span>,</span>
<span> group_title <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> font_family <span class="op">=</span> <span class="st">"Leelawadee"</span>,</span>
<span> font_size <span class="op">=</span> <span class="fl">12</span>,</span>
<span> position <span class="op">=</span> <span class="st">"dodge"</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> subtitle <span class="op">=</span> <span class="st">""</span>,</span>
<span> title_font_size <span class="op">=</span> <span class="fl">16</span>,</span>
<span> subtitle_font_size <span class="op">=</span> <span class="fl">14</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
</div>
@ -120,10 +117,6 @@
<dd><p>The font family. Default to "Leelawadee"</p></dd>
<dt>font_size</dt>
<dd><p>Body font size; default to 12</p></dd>
<dt>position</dt>
<dd><p>Should the chart be stacked? Default to dodge</p></dd>
@ -140,14 +133,6 @@
<dd><p>Plot subtitle. Default to empty string</p></dd>
<dt>title_font_size</dt>
<dd><p>Default to 16</p></dd>
<dt>subtitle_font_size</dt>
<dd><p>Default to 14</p></dd>
<dt>...</dt>
<dd><p>Other arguments to be passed to "ggblanket::gg_col"</p></dd>

View file

@ -63,13 +63,10 @@
<span> y_title <span class="op">=</span> <span class="st">""</span>,</span>
<span> group_title <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span> font_family <span class="op">=</span> <span class="st">"Leelawadee"</span>,</span>
<span> font_size <span class="op">=</span> <span class="fl">12</span>,</span>
<span> position <span class="op">=</span> <span class="st">"dodge"</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> subtitle <span class="op">=</span> <span class="st">""</span>,</span>
<span> title_font_size <span class="op">=</span> <span class="fl">16</span>,</span>
<span> subtitle_font_size <span class="op">=</span> <span class="fl">14</span>,</span>
<span> <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
</div>
@ -120,10 +117,6 @@
<dd><p>The font family. Default to "Leelawadee"</p></dd>
<dt>font_size</dt>
<dd><p>Body font size; default to 12</p></dd>
<dt>position</dt>
<dd><p>Should the chart be stacked? Default to dodge</p></dd>
@ -140,14 +133,6 @@
<dd><p>Plot subtitle. Default to empty string</p></dd>
<dt>title_font_size</dt>
<dd><p>Default to 16</p></dd>
<dt>subtitle_font_size</dt>
<dd><p>Default to 14</p></dd>
<dt>...</dt>
<dd><p>Other arguments to be passed to "ggblanket::gg_col"</p></dd>

File diff suppressed because one or more lines are too long

View file

@ -16,13 +16,10 @@ hbar(
y_title = "",
group_title = NULL,
font_family = "Leelawadee",
font_size = 12,
position = "dodge",
reverse = FALSE,
title = "",
subtitle = "",
title_font_size = 16,
subtitle_font_size = 14,
...
)
}
@ -49,8 +46,6 @@ hbar(
\item{font_family}{The font family. Default to "Leelawadee"}
\item{font_size}{Body font size; default to 12}
\item{position}{Should the chart be stacked? Default to dodge}
\item{reverse}{Boolean indicating whether the color palette should be reversed}
@ -59,10 +54,6 @@ hbar(
\item{subtitle}{Plot subtitle. Default to empty string}
\item{title_font_size}{Default to 16}
\item{subtitle_font_size}{Default to 14}
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
}
\value{

View file

@ -16,13 +16,10 @@ hbar_percent(
y_title = "",
group_title = NULL,
font_family = "Leelawadee",
font_size = 12,
position = "dodge",
reverse = FALSE,
title = "",
subtitle = "",
title_font_size = 16,
subtitle_font_size = 14,
...
)
}
@ -49,8 +46,6 @@ hbar_percent(
\item{font_family}{The font family. Default to "Leelawadee"}
\item{font_size}{Body font size; default to 12}
\item{position}{Should the chart be stacked? Default to dodge}
\item{reverse}{Boolean indicating whether the color palette should be reversed}
@ -59,10 +54,6 @@ hbar_percent(
\item{subtitle}{Plot subtitle. Default to empty string}
\item{title_font_size}{Default to 16}
\item{subtitle_font_size}{Default to 14}
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
}
\value{