Move from simplevis to successor ggblanket
This commit is contained in:
parent
15ab2819c7
commit
c8fdf41521
32 changed files with 227 additions and 446 deletions
10
DESCRIPTION
10
DESCRIPTION
|
|
@ -1,7 +1,7 @@
|
|||
Package: visualizeR
|
||||
Type: Package
|
||||
Title: What a color! What a viz!
|
||||
Version: 0.1.4.9000
|
||||
Version: 0.1.5.9000
|
||||
Authors@R: c(
|
||||
person(
|
||||
'Noblet', 'Guillaume',
|
||||
|
|
@ -18,6 +18,12 @@ License: GPL (>= 3)
|
|||
Encoding: UTF-8
|
||||
LazyData: true
|
||||
RoxygenNote: 7.2.0
|
||||
Imports: ggplot2, rlang, grDevices, simplevis, glue, scales
|
||||
Imports:
|
||||
ggplot2,
|
||||
rlang,
|
||||
grDevices,
|
||||
glue,
|
||||
scales,
|
||||
ggblanket
|
||||
Suggests: knitr, sf
|
||||
VignetteBuilder: knitr
|
||||
|
|
|
|||
8
NEWS.md
8
NEWS.md
|
|
@ -1,6 +1,12 @@
|
|||
# visualizeR 0.1.5.9000
|
||||
|
||||
* Move from `simplevis` to successor `ggblanket`.
|
||||
|
||||
---
|
||||
|
||||
# visualizeR 0.1.4.9000
|
||||
|
||||
* `hbar()`gains a new boolean argument `reverse` to pass to `pal_reach()` or `pal_agora()`, indicating if the color palette should be reversed or not.
|
||||
* `hbar()` gains a new boolean argument `reverse` to pass to `pal_reach()` or `pal_agora()`, indicating if the color palette should be reversed or not.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
140
R/hbar.R
140
R/hbar.R
|
|
@ -1,130 +1,74 @@
|
|||
#' @title Simple horizontal bar chart
|
||||
#'
|
||||
#' @description with nice percentage x labels
|
||||
#'
|
||||
#' @param .tbl Some data
|
||||
#' @param x Some numeric column on the x scale
|
||||
#' @param y Some column on the y scale
|
||||
#' @param group Some grouping categorical column, e.g. administrative areas
|
||||
#' @param initiative Either "reach" or "agora" or "impact" for the color palette
|
||||
#' @param pal The color palette from the initiative
|
||||
#' @param width Width.
|
||||
#' @param x_title The x scale title. Default to empty string
|
||||
#' @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 stack Should the chart be stacked? Default to "FALSE" (dodge)
|
||||
#' @param scales_percent Should x_labels be scaled to percentages? Default to TRUE.
|
||||
#' @param position Should the chart be stacked? Default to dodge
|
||||
#' @param reverse Boolean indicating whether the color palette should be reversed
|
||||
#' @param ... Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"
|
||||
#' @param title Plot title. Default to empty string
|
||||
#' @param subtitle Plot subtitle. Default to empty string
|
||||
#' @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", x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", stack = FALSE, reverse = FALSE, ...){
|
||||
hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", pal = "primary", width = 0.5, x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", scales_percent = TRUE, 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'"))
|
||||
|
||||
if (initiative == "reach") main_col <- pal_reach("main", reverse = reverse)
|
||||
if (initiative == "reach") {
|
||||
palette <- pal_reach(pal, reverse = reverse)
|
||||
main_col <- cols_reach("main_grey")
|
||||
|
||||
if (initiative == "agora") main_col <- pal_agora("main", reverse = reverse)
|
||||
if(is.null(palette)) rlang::warn(
|
||||
c(paste0("There is no palette '", pal, "' for initiative 'reach'. Fallback to ggblanket's default color palette."),
|
||||
"i" = paste0("Use `pal_reach(show_palettes = T)` to see the list of availabale palettes.")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (initiative == "impact") rlang::abort("IMPACT colors are under development")
|
||||
if (initiative == "agora") {
|
||||
palette <- pal_agora(pal, reverse = reverse)
|
||||
main_col <- cols_agora("main_bordeaux")
|
||||
|
||||
if (is.null(group)) {
|
||||
hbar <- .tbl |>
|
||||
simplevis::gg_hbar(
|
||||
x_var = {{ x }},
|
||||
y_var = {{ y }},
|
||||
theme = simplevis::gg_theme(font = font_family, pal_title = main_col),
|
||||
x_title = x_title,
|
||||
y_title = y_title,
|
||||
alpha_fill = 1,
|
||||
pal = main_col,
|
||||
x_labels = scales::percent,
|
||||
stack = stack,
|
||||
...)
|
||||
} else {
|
||||
group_name <- rlang::as_name(rlang::enquo(group))
|
||||
if_not_in_stop(.tbl, group_name)
|
||||
|
||||
if(is.null(palette)) rlang::warn(
|
||||
c(paste0("There is no palette '", pal, "' for initiative 'agora'. Fallback to ggblanket's default color palette."),
|
||||
"i" = paste0("Use `pal_agora(show_palettes = T)` to see the list of availabale palettes.")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (initiative == "impact") rlang::warn("IMPACT colors are under development. Fallback to ggblanket's default.")
|
||||
|
||||
hbar <- .tbl |>
|
||||
simplevis::gg_hbar_col(
|
||||
x_var = {{ x }},
|
||||
y_var = {{ y }},
|
||||
col_var = {{ group }},
|
||||
theme = simplevis::gg_theme(font = font_family, pal_title = main_col),
|
||||
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,
|
||||
alpha_fill = 1,
|
||||
pal = main_col,
|
||||
x_labels = scales::percent,
|
||||
stack = stack,
|
||||
...)
|
||||
}
|
||||
|
||||
return(hbar)
|
||||
}
|
||||
|
||||
#' @title Simple horizontal bar chart
|
||||
#'
|
||||
#' @description without any change to the x scale
|
||||
#'
|
||||
#' @param .tbl Some data
|
||||
#' @param x Some numeric column on the x scale
|
||||
#' @param y Some column on the y scale
|
||||
#' @param group Some grouping categorical column, e.g. administrative areas
|
||||
#' @param initiative Either "reach" or "agora" or "impact" for the color palette
|
||||
#' @param x_title The x scale title. Default to empty string
|
||||
#' @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 stack Should the chart be stacked? Default to "FALSE" (dodge)
|
||||
#' @param reverse Boolean indicating whether the color palette should be reversed
|
||||
#' @param ... Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"
|
||||
#'
|
||||
#' @return A horizontal bar chart
|
||||
#'
|
||||
#' @export
|
||||
hbar <- function(.tbl, x, y, group = NULL, initiative = "reach", x_title = "", y_title = "", group_title = NULL, font_family = "Leelawadee", stack = FALSE, reverse = FALSE,...){
|
||||
|
||||
|
||||
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 == "reach") main_col <- pal_reach("main", reverse = reverse)
|
||||
|
||||
if (initiative == "agora") main_col <- pal_agora("main", reverse = reverse)
|
||||
|
||||
if (initiative == "impact") rlang::abort("IMPACT colors are under development")
|
||||
|
||||
if (is.null(group)) {
|
||||
hbar <- .tbl |>
|
||||
simplevis::gg_hbar(
|
||||
x_var = {{ x }},
|
||||
y_var = {{ y }},
|
||||
theme = simplevis::gg_theme(font = font_family, pal_title = main_col),
|
||||
x_title = x_title,
|
||||
y_title = y_title,
|
||||
alpha_fill = 1,
|
||||
pal = main_col,
|
||||
...)
|
||||
} else {
|
||||
group_name <- rlang::as_name(rlang::enquo(group))
|
||||
if_not_in_stop(.tbl, group_name)
|
||||
|
||||
hbar <- .tbl |>
|
||||
simplevis::gg_hbar_col(
|
||||
x_var = {{ x }},
|
||||
y_var = {{ y }},
|
||||
col_var = {{ group }},
|
||||
theme = simplevis::gg_theme(font = font_family, pal_title = main_col),
|
||||
x_title = x_title,
|
||||
y_title = y_title,
|
||||
col_title = group_title,
|
||||
alpha_fill = 1,
|
||||
pal = main_col,
|
||||
stack = stack,
|
||||
...)
|
||||
}
|
||||
pal = palette,
|
||||
width = width,
|
||||
x_labels = ifelse(scales_percent, scales::percent, NULL),
|
||||
position = position,
|
||||
stat = "identity",
|
||||
title = "",
|
||||
subtitle = "",
|
||||
...
|
||||
)
|
||||
|
||||
return(hbar)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="https://gnoblet.github.io/visualizeR/index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
@ -45,7 +45,6 @@
|
|||
</div>
|
||||
|
||||
<div id="gnu-general-public-license" class="section level1">
|
||||
|
||||
<p><em>Version 3, 29 June 2007</em><br><em>Copyright © 2007 Free Software Foundation, Inc. <<a href="http://fsf.org/" class="external-link uri">http://fsf.org/</a>></em></p>
|
||||
<p>Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.</p>
|
||||
<div class="section level2">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
@ -72,9 +72,7 @@
|
|||
<img src="logo.png" class="logo" alt=""><h1 id="visualizer-">visualizeR <a class="anchor" aria-label="anchor" href="#visualizer-"></a>
|
||||
</h1>
|
||||
</div>
|
||||
<blockquote>
|
||||
<p>What a color! What a viz!</p>
|
||||
</blockquote>
|
||||
<blockquote><p>What a color! What a viz!</p></blockquote>
|
||||
<p><code>visualizeR</code> proposes some utils to get REACH and AGORA colors, ready-to-go color palettes, and a few visualization functions (horizontal hist graph for instance).</p>
|
||||
<div class="section level2">
|
||||
<h2 id="installation">Installation<a class="anchor" aria-label="anchor" href="#installation"></a>
|
||||
|
|
@ -90,23 +88,17 @@
|
|||
<p>Roadmap is as follows:</p>
|
||||
<ul class="task-list">
|
||||
<li>
|
||||
<input type="checkbox" disabled>
|
||||
Add IMPACT’s colors</li>
|
||||
<input type="checkbox" disabled>Add IMPACT’s colors</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>
|
||||
Add all color palettes from the internal documentation</li>
|
||||
<input type="checkbox" disabled>Add all color palettes from the internal documentation</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>
|
||||
Add new types of visualization (e.g. dumbbell plot)</li>
|
||||
<input type="checkbox" disabled>Add new types of visualization (e.g. dumbbell plot)</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>
|
||||
Use examples</li>
|
||||
<input type="checkbox" disabled>Use examples</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>
|
||||
Add some ease-map functions</li>
|
||||
<input type="checkbox" disabled>Add some ease-map functions</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>
|
||||
Add some interactive functions (maps and graphs)</li>
|
||||
<input type="checkbox" disabled>Add some interactive functions (maps and graphs)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
@ -44,23 +44,23 @@
|
|||
<small>Source: <a href="https://github.com/gnoblet/visualizeR/blob/HEAD/NEWS.md" class="external-link"><code>NEWS.md</code></a></small>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="0.1.5.9000" id="visualizer-0159000">visualizeR 0.1.5.9000<a class="anchor" aria-label="anchor" href="#visualizer-0159000"></a></h2>
|
||||
<ul><li>Move from <code>simplevis</code> to successor <code>ggblanket</code>.</li></ul><hr></div>
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="0.1.4.9000" id="visualizer-0149000">visualizeR 0.1.4.9000<a class="anchor" aria-label="anchor" href="#visualizer-0149000"></a></h2>
|
||||
<ul><li>
|
||||
<code><a href="../reference/hbar.html">hbar()</a></code>gains a new boolean argument <code>reverse</code> to pass to <code><a href="../reference/pal_reach.html">pal_reach()</a></code> or <code><a href="../reference/pal_agora.html">pal_agora()</a></code>, indicating if the color palette should be reversed or not.</li>
|
||||
</ul><hr></div>
|
||||
<code><a href="../reference/hbar.html">hbar()</a></code> gains a new boolean argument <code>reverse</code> to pass to <code><a href="../reference/pal_reach.html">pal_reach()</a></code> or <code><a href="../reference/pal_agora.html">pal_agora()</a></code>, indicating if the color palette should be reversed or not.</li></ul><hr></div>
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="0.1.3.9000" id="visualizer-0139000">visualizeR 0.1.3.9000<a class="anchor" aria-label="anchor" href="#visualizer-0139000"></a></h2>
|
||||
<ul><li>Small change to <code><a href="../reference/hbar.html">hbar()</a></code>: removes error arg within <code><a href="https://statisticsnz.github.io/simplevis/reference/gg_hbar.html" class="external-link">simplevis::gg_hbar()</a></code> call.</li>
|
||||
</ul><hr></div>
|
||||
<ul><li>Small change to <code><a href="../reference/hbar.html">hbar()</a></code>: removes error arg within <code><a href="https://statisticsnz.github.io/simplevis/reference/gg_hbar.html" class="external-link">simplevis::gg_hbar()</a></code> call.</li></ul><hr></div>
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="0.1.2.9000" id="visualizer-0129000">visualizeR 0.1.2.9000<a class="anchor" aria-label="anchor" href="#visualizer-0129000"></a></h2>
|
||||
<ul><li>There was a duplicate <code><a href="../reference/scale_color.html">scale_color()</a></code> function, which should have been and is now <code><a href="../reference/scale_fill.html">scale_fill()</a></code>
|
||||
</li>
|
||||
</ul><hr></div>
|
||||
</li></ul><hr></div>
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="0.1.1.9000" id="visualizer-0119000">visualizeR 0.1.1.9000<a class="anchor" aria-label="anchor" href="#visualizer-0119000"></a></h2>
|
||||
<ul><li>Added two horizontal bar functions: <code><a href="../reference/hbar.html">hbar()</a></code>, <code><a href="../reference/hbar_percent.html">hbar_percent()</a></code> (<a href="https://github.com/gnoblet/visualizeR/issues/3" class="external-link">#3</a>)</li>
|
||||
<ul><li>Added two horizontal bar functions: <code><a href="../reference/hbar.html">hbar()</a></code>, <code>hbar_percent()</code> (<a href="https://github.com/gnoblet/visualizeR/issues/3" class="external-link">#3</a>)</li>
|
||||
<li>Added some internals to check for missing columns and bad arguments (<a href="https://github.com/gnoblet/visualizeR/issues/3" class="external-link">#3</a>)</li>
|
||||
<li>Modified some <code><a href="../reference/theme_reach.html">theme_reach()</a></code> documentation</li>
|
||||
<li>Add <code><a href="../reference/buffer_bbox.html">buffer_bbox()</a></code> function to produce a buffered bbox, e.g. for use with <code>tmap</code>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
pandoc: 2.17.1.1
|
||||
pandoc: 2.14.0.3
|
||||
pkgdown: 2.0.5
|
||||
pkgdown_sha: ~
|
||||
articles: {}
|
||||
last_built: 2022-07-07T00:14Z
|
||||
last_built: 2022-07-10T15:16Z
|
||||
urls:
|
||||
reference: https://gnoblet.github.io/visualizeR/reference
|
||||
article: https://gnoblet.github.io/visualizeR/articles
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="without any change to the x scale"><title>Simple horizontal bar chart — hbar • visualizeR</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.1.0/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.1.0/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- bootstrap-toc --><script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Simple horizontal bar chart — hbar"><meta property="og:description" content="without any change to the x scale"><meta property="og:image" content="https://gnoblet.github.io/visualizeR/logo.png"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="Simple horizontal bar chart"><title>Simple horizontal bar chart — hbar • visualizeR</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.1.0/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.1.0/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- bootstrap-toc --><script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Simple horizontal bar chart — hbar"><meta property="og:description" content="Simple horizontal bar chart"><meta property="og:image" content="https://gnoblet.github.io/visualizeR/logo.png"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]--></head><body>
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>without any change to the x scale</p>
|
||||
<p>Simple horizontal bar chart</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
|
|
@ -57,12 +57,17 @@
|
|||
<span> <span class="va">y</span>,</span>
|
||||
<span> group <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> initiative <span class="op">=</span> <span class="st">"reach"</span>,</span>
|
||||
<span> pal <span class="op">=</span> <span class="st">"primary"</span>,</span>
|
||||
<span> width <span class="op">=</span> <span class="fl">0.5</span>,</span>
|
||||
<span> x_title <span class="op">=</span> <span class="st">""</span>,</span>
|
||||
<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> stack <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> scales_percent <span class="op">=</span> <span class="cn">TRUE</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> <span class="va">...</span></span>
|
||||
<span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
|
@ -89,6 +94,14 @@
|
|||
<dd><p>Either "reach" or "agora" or "impact" for the color palette</p></dd>
|
||||
|
||||
|
||||
<dt>pal</dt>
|
||||
<dd><p>The color palette from the initiative</p></dd>
|
||||
|
||||
|
||||
<dt>width</dt>
|
||||
<dd><p>Width.</p></dd>
|
||||
|
||||
|
||||
<dt>x_title</dt>
|
||||
<dd><p>The x scale title. Default to empty string</p></dd>
|
||||
|
||||
|
|
@ -105,16 +118,28 @@
|
|||
<dd><p>The font family. Default to "Leelawadee"</p></dd>
|
||||
|
||||
|
||||
<dt>stack</dt>
|
||||
<dd><p>Should the chart be stacked? Default to "FALSE" (dodge)</p></dd>
|
||||
<dt>scales_percent</dt>
|
||||
<dd><p>Should x_labels be scaled to percentages? Default to TRUE.</p></dd>
|
||||
|
||||
|
||||
<dt>position</dt>
|
||||
<dd><p>Should the chart be stacked? Default to dodge</p></dd>
|
||||
|
||||
|
||||
<dt>reverse</dt>
|
||||
<dd><p>Boolean indicating whether the color palette should be reversed</p></dd>
|
||||
|
||||
|
||||
<dt>title</dt>
|
||||
<dd><p>Plot title. Default to empty string</p></dd>
|
||||
|
||||
|
||||
<dt>subtitle</dt>
|
||||
<dd><p>Plot subtitle. Default to empty string</p></dd>
|
||||
|
||||
|
||||
<dt>...</dt>
|
||||
<dd><p>Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"</p></dd>
|
||||
<dd><p>Other arguments to be passed to "ggblanket::gg_col"</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
|
|
|
|||
|
|
@ -1,146 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="description" content="with nice percentage x labels"><title>Simple horizontal bar chart — hbar_percent • visualizeR</title><!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png"><link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png"><link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png"><link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png"><link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png"><link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png"><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.1.0/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.1.0/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- bootstrap-toc --><script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Simple horizontal bar chart — hbar_percent"><meta property="og:description" content="with nice percentage x labels"><meta property="og:image" content="https://gnoblet.github.io/visualizeR/logo.png"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]--></head><body>
|
||||
<a href="#main" class="visually-hidden-focusable">Skip to contents</a>
|
||||
|
||||
|
||||
<nav class="navbar fixed-top navbar-light navbar-expand-lg bg-light"><div class="container">
|
||||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div id="navbar" class="collapse navbar-collapse ms-3">
|
||||
<ul class="navbar-nav me-auto"><li class="active nav-item">
|
||||
<a class="nav-link" href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="../news/index.html">Changelog</a>
|
||||
</li>
|
||||
</ul><form class="form-inline my-2 my-lg-0" role="search">
|
||||
<input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off"></form>
|
||||
|
||||
<ul class="navbar-nav"><li class="nav-item">
|
||||
<a class="external-link nav-link" href="https://github.com/gnoblet/visualizeR/" aria-label="github">
|
||||
<span class="fab fa fab fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul></div>
|
||||
|
||||
|
||||
</div>
|
||||
</nav><div class="container template-reference-topic">
|
||||
<div class="row">
|
||||
<main id="main" class="col-md-9"><div class="page-header">
|
||||
<img src="../logo.png" class="logo" alt=""><h1>Simple horizontal bar chart</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/gnoblet/visualizeR/blob/HEAD/R/hbar.R" class="external-link"><code>R/hbar.R</code></a></small>
|
||||
<div class="d-none name"><code>hbar_percent.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>with nice percentage x labels</p>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
|
||||
<div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">hbar_percent</span><span class="op">(</span></span>
|
||||
<span> <span class="va">.tbl</span>,</span>
|
||||
<span> <span class="va">x</span>,</span>
|
||||
<span> <span class="va">y</span>,</span>
|
||||
<span> group <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> initiative <span class="op">=</span> <span class="st">"reach"</span>,</span>
|
||||
<span> x_title <span class="op">=</span> <span class="st">""</span>,</span>
|
||||
<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> stack <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> <span class="va">...</span></span>
|
||||
<span><span class="op">)</span></span></code></pre></div>
|
||||
</div>
|
||||
|
||||
<div class="section level2">
|
||||
<h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
|
||||
<dl><dt>.tbl</dt>
|
||||
<dd><p>Some data</p></dd>
|
||||
|
||||
|
||||
<dt>x</dt>
|
||||
<dd><p>Some numeric column on the x scale</p></dd>
|
||||
|
||||
|
||||
<dt>y</dt>
|
||||
<dd><p>Some column on the y scale</p></dd>
|
||||
|
||||
|
||||
<dt>group</dt>
|
||||
<dd><p>Some grouping categorical column, e.g. administrative areas</p></dd>
|
||||
|
||||
|
||||
<dt>initiative</dt>
|
||||
<dd><p>Either "reach" or "agora" or "impact" for the color palette</p></dd>
|
||||
|
||||
|
||||
<dt>x_title</dt>
|
||||
<dd><p>The x scale title. Default to empty string</p></dd>
|
||||
|
||||
|
||||
<dt>y_title</dt>
|
||||
<dd><p>The y scale title. Default to empty string</p></dd>
|
||||
|
||||
|
||||
<dt>group_title</dt>
|
||||
<dd><p>The group legend title. Defaut to NULL</p></dd>
|
||||
|
||||
|
||||
<dt>font_family</dt>
|
||||
<dd><p>The font family. Default to "Leelawadee"</p></dd>
|
||||
|
||||
|
||||
<dt>stack</dt>
|
||||
<dd><p>Should the chart be stacked? Default to "FALSE" (dodge)</p></dd>
|
||||
|
||||
|
||||
<dt>reverse</dt>
|
||||
<dd><p>Boolean indicating whether the color palette should be reversed</p></dd>
|
||||
|
||||
|
||||
<dt>...</dt>
|
||||
<dd><p>Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
||||
|
||||
<p>A horizontal bar chart</p>
|
||||
</div>
|
||||
|
||||
</main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
|
||||
</nav></aside></div>
|
||||
|
||||
|
||||
<footer><div class="pkgdown-footer-left">
|
||||
<p></p><p>Developed by Noblet Guillaume.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown-footer-right">
|
||||
<p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.5.</p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
@ -81,11 +81,6 @@
|
|||
<dd>Simple horizontal bar chart</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="hbar_percent.html">hbar_percent()</a></code>
|
||||
</dt>
|
||||
<dd>Simple horizontal bar chart</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="if_not_in_stop.html">if_not_in_stop()</a></code>
|
||||
</dt>
|
||||
<dd>Stop statement "If not in colnames" with colnames</dd>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
||||
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.4.9000</small>
|
||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.1.5.9000</small>
|
||||
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -3,15 +3,15 @@
|
|||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/404.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/LICENSE.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/authors.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/index.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/LICENSE.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/news/index.html</loc>
|
||||
</url>
|
||||
|
|
@ -30,9 +30,6 @@
|
|||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/hbar.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/hbar_percent.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/if_not_in_stop.html</loc>
|
||||
</url>
|
||||
|
|
|
|||
23
man/hbar.Rd
23
man/hbar.Rd
|
|
@ -10,12 +10,17 @@ hbar(
|
|||
y,
|
||||
group = NULL,
|
||||
initiative = "reach",
|
||||
pal = "primary",
|
||||
width = 0.5,
|
||||
x_title = "",
|
||||
y_title = "",
|
||||
group_title = NULL,
|
||||
font_family = "Leelawadee",
|
||||
stack = FALSE,
|
||||
scales_percent = TRUE,
|
||||
position = "dodge",
|
||||
reverse = FALSE,
|
||||
title = "",
|
||||
subtitle = "",
|
||||
...
|
||||
)
|
||||
}
|
||||
|
|
@ -30,6 +35,10 @@ hbar(
|
|||
|
||||
\item{initiative}{Either "reach" or "agora" or "impact" for the color palette}
|
||||
|
||||
\item{pal}{The color palette from the initiative}
|
||||
|
||||
\item{width}{Width.}
|
||||
|
||||
\item{x_title}{The x scale title. Default to empty string}
|
||||
|
||||
\item{y_title}{The y scale title. Default to empty string}
|
||||
|
|
@ -38,15 +47,21 @@ hbar(
|
|||
|
||||
\item{font_family}{The font family. Default to "Leelawadee"}
|
||||
|
||||
\item{stack}{Should the chart be stacked? Default to "FALSE" (dodge)}
|
||||
\item{scales_percent}{Should x_labels be scaled to percentages? Default to TRUE.}
|
||||
|
||||
\item{position}{Should the chart be stacked? Default to dodge}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the color palette should be reversed}
|
||||
|
||||
\item{...}{Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"}
|
||||
\item{title}{Plot title. Default to empty string}
|
||||
|
||||
\item{subtitle}{Plot subtitle. Default to empty string}
|
||||
|
||||
\item{...}{Other arguments to be passed to "ggblanket::gg_col"}
|
||||
}
|
||||
\value{
|
||||
A horizontal bar chart
|
||||
}
|
||||
\description{
|
||||
without any change to the x scale
|
||||
Simple horizontal bar chart
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/hbar.R
|
||||
\name{hbar_percent}
|
||||
\alias{hbar_percent}
|
||||
\title{Simple horizontal bar chart}
|
||||
\usage{
|
||||
hbar_percent(
|
||||
.tbl,
|
||||
x,
|
||||
y,
|
||||
group = NULL,
|
||||
initiative = "reach",
|
||||
x_title = "",
|
||||
y_title = "",
|
||||
group_title = NULL,
|
||||
font_family = "Leelawadee",
|
||||
stack = FALSE,
|
||||
reverse = FALSE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{.tbl}{Some data}
|
||||
|
||||
\item{x}{Some numeric column on the x scale}
|
||||
|
||||
\item{y}{Some column on the y scale}
|
||||
|
||||
\item{group}{Some grouping categorical column, e.g. administrative areas}
|
||||
|
||||
\item{initiative}{Either "reach" or "agora" or "impact" for the color palette}
|
||||
|
||||
\item{x_title}{The x scale title. Default to empty string}
|
||||
|
||||
\item{y_title}{The y scale title. Default to empty string}
|
||||
|
||||
\item{group_title}{The group legend title. Defaut to NULL}
|
||||
|
||||
\item{font_family}{The font family. Default to "Leelawadee"}
|
||||
|
||||
\item{stack}{Should the chart be stacked? Default to "FALSE" (dodge)}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the color palette should be reversed}
|
||||
|
||||
\item{...}{Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"}
|
||||
}
|
||||
\value{
|
||||
A horizontal bar chart
|
||||
}
|
||||
\description{
|
||||
with nice percentage x labels
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue