Update to v0.6.9000
|
|
@ -3,7 +3,6 @@
|
|||
#' @param df A data frame.
|
||||
#' @param x A numeric column.
|
||||
#' @param y A character column or coercible as a character column.
|
||||
#' @param group Some grouping categorical column, e.g. administrative areas or population groups.
|
||||
#' @param flip TRUE or FALSE. Default to TRUE or horizontal lollipop plot.
|
||||
#' @param wrap Should x-labels be wrapped? Number of characters.
|
||||
#' @param arrange TRUE or FALSE. Arrange by highest percentage first.
|
||||
|
|
@ -16,11 +15,11 @@
|
|||
#' @param alpha Fill transparency.
|
||||
#' @param x_title The x scale title. Default to NULL.
|
||||
#' @param y_title The y scale title. Default to NULL.
|
||||
#' @param group_title The group legend title. Default to NULL.
|
||||
#' @param title Plot title. Default to NULL.
|
||||
#' @param subtitle Plot subtitle. Default to NULL.
|
||||
#' @param caption Plot caption. Default to NULL.
|
||||
#' @param add_text TRUE or FALSE. Add the y value as text within the bubble.
|
||||
#' @param add_text_size Text size.
|
||||
#' @param add_text_suffix If percent is FALSE, should we add a suffix to the text label?
|
||||
#' @param add_text_color Added text color. Default to white.
|
||||
#' @param add_text_fontface Added text font face. Default to "bold".
|
||||
|
|
|
|||
141
README.md
|
|
@ -27,10 +27,12 @@ Roadmap is as follows:
|
|||
- [x] Add all color palettes from the internal documentation
|
||||
- [ ] There remains to be added more-than-7-color palettes and black
|
||||
color palettes
|
||||
- [ ] Add new types of visualization (e.g. dumbbell plot)
|
||||
- [ ] Use examples
|
||||
- [x] Add new types of visualization (e.g. dumbbell plot, lollipop
|
||||
plot, etc.)
|
||||
- [x] Use examples
|
||||
- [ ] Add some ease-map functions
|
||||
- [ ] Add some interactive functions (maps and graphs)
|
||||
- [ ] Consolidate and make errors transparent
|
||||
|
||||
## Request
|
||||
|
||||
|
|
@ -93,21 +95,21 @@ df <- penguins |>
|
|||
bar(df, island, mean_bl, species, percent = FALSE, alpha = 0.6, x_title = "Mean of bill length")
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-bar-chart-1.png" width="100%" />
|
||||
<img src="man/figures/README-example-bar-chart-1.png" width="65%" />
|
||||
|
||||
``` r
|
||||
# Using another color palette through `theme_reach()` and changing scale to percent
|
||||
bar(df, island,mean_bl, species, percent = TRUE, theme = theme_reach(palette = "artichoke_3"))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-bar-chart-2.png" width="100%" />
|
||||
<img src="man/figures/README-example-bar-chart-2.png" width="65%" />
|
||||
|
||||
``` r
|
||||
# Not flipped, with text added, group_title, no y-axis and no bold for legend
|
||||
bar(df, island, mean_bl, species, group_title = "Species", flip = FALSE, add_text = TRUE, add_text_suffix = "%", percent = FALSE, theme = theme_reach(text_font_face = "plain", axis_y = FALSE))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-bar-chart-3.png" width="100%" />
|
||||
<img src="man/figures/README-example-bar-chart-3.png" width="65%" />
|
||||
|
||||
### Example 2: Point chart, already REACH themed
|
||||
|
||||
|
|
@ -119,23 +121,23 @@ with the `group` arg.
|
|||
point(penguins, bill_length_mm, flipper_length_mm)
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-point-chart-1.png" width="100%" />
|
||||
<img src="man/figures/README-example-point-chart-1.png" width="65%" />
|
||||
|
||||
``` r
|
||||
# Point chart with grouping colors, greater dot size, some transparency, reversed color palette
|
||||
point(penguins, bill_length_mm, flipper_length_mm, island, alpha = 0.6, size = 3, theme = theme_reach(reverse = TRUE))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-point-chart-2.png" width="100%" />
|
||||
<img src="man/figures/README-example-point-chart-2.png" width="65%" />
|
||||
|
||||
``` r
|
||||
# Using another color palettes
|
||||
point(penguins, bill_length_mm, flipper_length_mm, island, size = 1.5, x_title = "Bill", y_title = "Flipper", title = "Length (mm)", theme = theme_reach(palette = "artichoke_3", text_font_face = , grid_x = T, title_position_to_plot = FALSE))
|
||||
point(penguins, bill_length_mm, flipper_length_mm, island, size = 1.5, x_title = "Bill", y_title = "Flipper", title = "Length (mm)", theme = theme_reach(palette = "artichoke_3", text_font_face = , grid_major_x = TRUE, title_position_to_plot = FALSE))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-point-chart-3.png" width="100%" />
|
||||
<img src="man/figures/README-example-point-chart-3.png" width="65%" />
|
||||
|
||||
### Example 3! Dumbbell plot, REACH themed
|
||||
### Example 3: Dumbbell plot, REACH themed
|
||||
|
||||
Remember to ensure that your data are in the long format and you only
|
||||
have two groups on the x-axis; for instance, IDP and returnee and no NA
|
||||
|
|
@ -144,26 +146,137 @@ values.
|
|||
``` r
|
||||
# Prepare long data
|
||||
df <- tibble::tibble(
|
||||
admin1 = rep(c("A", "B", "C", "D", "E", "F", "G", "H"), 2),
|
||||
admin1 = rep(letters[1:8], 2),
|
||||
setting = c(rep(c("Rural", "Urban"), 4), rep(c("Urban", "Rural"), 4)),
|
||||
stat = rnorm(16, mean = 50, sd = 18)
|
||||
) |>
|
||||
dplyr::mutate(stat = round(stat, 0))
|
||||
|
||||
# Example
|
||||
# Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title
|
||||
dumbbell(df,
|
||||
stat,
|
||||
setting,
|
||||
admin1,
|
||||
title = "% of HHs that reported open defecation as sanitation facility",
|
||||
group_y_title = "Admin 1",
|
||||
group_x_title = "Setting",
|
||||
theme = theme_reach(legend_position = "bottom",
|
||||
legend_direction = "horizontal",
|
||||
legend_title_font_face = "bold",
|
||||
palette = "primary",
|
||||
title_position_to_plot = FALSE))
|
||||
title_position_to_plot = FALSE,
|
||||
legend.title.align = 0.5)) +
|
||||
# Change legend title position (could be included as part of the function)
|
||||
ggplot2::guides(
|
||||
color = ggplot2::guide_legend(title.position = "left"),
|
||||
fill = ggplot2::guide_legend(title.position = "left")
|
||||
)
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-dumbbell-plot-1.png" width="100%" />
|
||||
<img src="man/figures/README-example-dumbbell-plot-1.png" width="65%" />
|
||||
|
||||
### Example 4: donut chart, REACH themed (to used moderately)
|
||||
|
||||
``` r
|
||||
# Some summarized data: % of HHs by displacement status
|
||||
df <- tibble::tibble(
|
||||
status = c("Displaced", "Non displaced", "Returnee", "Don't know/Prefer not to say"),
|
||||
percentage = c(18, 65, 12, 3)
|
||||
)
|
||||
|
||||
# Donut
|
||||
donut(df,
|
||||
status,
|
||||
percentage,
|
||||
hole_size = 3,
|
||||
add_text_suffix = "%",
|
||||
add_text_color = cols_reach("dk_grey"),
|
||||
add_text_treshold_display = 5,
|
||||
x_title = "Displacement status",
|
||||
title = "% of HHs by displacement status",
|
||||
theme = theme_reach(legend_reverse = TRUE))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-donut-plot-1.png" width="65%" />
|
||||
|
||||
### Example 5: alluvial chart, REACH themed
|
||||
|
||||
``` r
|
||||
# Some summarized data: % of HHs by self-reported status of displacement in 2021 and in 2022
|
||||
df <- tibble::tibble(
|
||||
status_from = c(rep("Displaced", 4),
|
||||
rep("Non displaced", 4),
|
||||
rep("Returnee", 4),
|
||||
rep("Dnk/Pnts", 4)),
|
||||
status_to = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts"),
|
||||
percentage = c(20, 8, 18, 1, 12, 21, 0, 2, 0, 3, 12, 1, 0, 0, 1, 1)
|
||||
)
|
||||
|
||||
# Alluvial, here the group is the status for 2021
|
||||
|
||||
alluvial(df,
|
||||
status_from,
|
||||
status_to,
|
||||
percentage,
|
||||
status_from,
|
||||
from_levels = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts"),
|
||||
alpha = 0.8,
|
||||
group_title = "Status for 2021",
|
||||
title = "% of HHs by self-reported status from 2021 to 2022",
|
||||
theme = theme_reach(
|
||||
axis_y = FALSE,
|
||||
legend_position = "none"))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-alluvial-plot-1.png" width="65%" />
|
||||
|
||||
### Example 6: lollipop chart
|
||||
|
||||
``` r
|
||||
library(tidyr)
|
||||
# Prepare long data
|
||||
df <- tibble::tibble(
|
||||
admin1 = replicate(15, sample(letters, 8)) |> t() |> as.data.frame() |> unite("admin1", sep = "") |> dplyr::pull(admin1),
|
||||
stat = rnorm(15, mean = 50, sd = 15)) |>
|
||||
dplyr::mutate(stat = round(stat, 0))
|
||||
|
||||
# Make lollipop plot, REACH themed, vertical with 45 degrees angle X-labels
|
||||
lollipop(df,
|
||||
admin1,
|
||||
stat,
|
||||
arrange = FALSE,
|
||||
add_text = FALSE,
|
||||
flip = FALSE,
|
||||
y_title = "% of HHs",
|
||||
x_title = "Admin 1",
|
||||
title = "% of HHs that reported having received a humanitarian assistance",
|
||||
theme = theme_reach(axis_text_x_angle = 45,
|
||||
grid_major_y = TRUE,
|
||||
grid_major_y_size = 0.2,
|
||||
grid_major_x = TRUE,
|
||||
grid_minor_y = TRUE))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-lollipop-chart-1.png" width="65%" />
|
||||
|
||||
``` r
|
||||
# Horizontal, greater point size, arranged by value, no grid, and text labels added
|
||||
lollipop(df,
|
||||
admin1,
|
||||
stat,
|
||||
arrange = TRUE,
|
||||
point_size = 10,
|
||||
point_color = cols_reach("main_beige"),
|
||||
segment_size = 2,
|
||||
add_text = TRUE,
|
||||
add_text_suffix = "%",
|
||||
y_title = "% of HHs",
|
||||
x_title = "Admin 1",
|
||||
title = "% of HHs that reported having received a humanitarian assistance in the 12 months prior to the assessment",
|
||||
theme = theme_reach(title_position_to_plot = FALSE))
|
||||
```
|
||||
|
||||
<img src="man/figures/README-example-lollipop-chart-2.png" width="65%" />
|
||||
|
||||
## Maps
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
<h2 id="citation">Citation</h2>
|
||||
<p><small class="dont-index">Source: <a href="https://github.com/gnoblet/visualizeR/blob/HEAD/DESCRIPTION" class="external-link"><code>DESCRIPTION</code></a></small></p>
|
||||
|
||||
<p>Guillaume N (2022).
|
||||
<p>Guillaume N (2023).
|
||||
<em>visualizeR: What a color! What a viz!</em>.
|
||||
https://github.com/gnoblet/visualizeR,
|
||||
https://gnoblet.github.io/visualizeR/.
|
||||
|
|
@ -64,7 +64,7 @@ https://gnoblet.github.io/visualizeR/.
|
|||
<pre>@Manual{,
|
||||
title = {visualizeR: What a color! What a viz!},
|
||||
author = {Noblet Guillaume},
|
||||
year = {2022},
|
||||
year = {2023},
|
||||
note = {https://github.com/gnoblet/visualizeR,
|
||||
https://gnoblet.github.io/visualizeR/},
|
||||
}</pre>
|
||||
|
|
|
|||
137
docs/index.html
|
|
@ -94,13 +94,15 @@
|
|||
<li>
|
||||
<input type="checkbox" disabled>There remains to be added more-than-7-color palettes and black color palettes</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>Add new types of visualization (e.g. dumbbell plot)</li>
|
||||
<input type="checkbox" disabled checked>Add new types of visualization (e.g. dumbbell plot, lollipop plot, etc.)</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>Use examples</li>
|
||||
<input type="checkbox" disabled checked>Use examples</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>Add some ease-map functions</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>Add some interactive functions (maps and graphs)</li>
|
||||
<li>
|
||||
<input type="checkbox" disabled>Consolidate and make errors transparent</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
|
|
@ -158,15 +160,15 @@
|
|||
<span></span>
|
||||
<span><span class="co"># Simple bar chart by group with some alpha transparency</span></span>
|
||||
<span><span class="fu"><a href="reference/bar.html">bar</a></span><span class="op">(</span><span class="va">df</span>, <span class="va">island</span>, <span class="va">mean_bl</span>, <span class="va">species</span>, percent <span class="op">=</span> <span class="cn">FALSE</span>, alpha <span class="op">=</span> <span class="fl">0.6</span>, x_title <span class="op">=</span> <span class="st">"Mean of bill length"</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-bar-chart-1.png" width="100%"></p>
|
||||
<p><img src="reference/figures/README-example-bar-chart-1.png" width="65%"></p>
|
||||
<div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Using another color palette through `theme_reach()` and changing scale to percent</span></span>
|
||||
<span><span class="fu"><a href="reference/bar.html">bar</a></span><span class="op">(</span><span class="va">df</span>, <span class="va">island</span>,<span class="va">mean_bl</span>, <span class="va">species</span>, percent <span class="op">=</span> <span class="cn">TRUE</span>, theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>palette <span class="op">=</span> <span class="st">"artichoke_3"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-bar-chart-2.png" width="100%"></p>
|
||||
<p><img src="reference/figures/README-example-bar-chart-2.png" width="65%"></p>
|
||||
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Not flipped, with text added, group_title, no y-axis and no bold for legend</span></span>
|
||||
<span><span class="fu"><a href="reference/bar.html">bar</a></span><span class="op">(</span><span class="va">df</span>, <span class="va">island</span>, <span class="va">mean_bl</span>, <span class="va">species</span>, group_title <span class="op">=</span> <span class="st">"Species"</span>, flip <span class="op">=</span> <span class="cn">FALSE</span>, add_text <span class="op">=</span> <span class="cn">TRUE</span>, add_text_suffix <span class="op">=</span> <span class="st">"%"</span>, percent <span class="op">=</span> <span class="cn">FALSE</span>, theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>text_font_face <span class="op">=</span> <span class="st">"plain"</span>, axis_y <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-bar-chart-3.png" width="100%"></p>
|
||||
<p><img src="reference/figures/README-example-bar-chart-3.png" width="65%"></p>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
<h3 id="example-2-point-chart-already-reach-themed">Example 2: Point chart, already REACH themed<a class="anchor" aria-label="anchor" href="#example-2-point-chart-already-reach-themed"></a>
|
||||
|
|
@ -175,47 +177,152 @@
|
|||
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Simple point chart</span></span>
|
||||
<span><span class="fu"><a href="reference/point.html">point</a></span><span class="op">(</span><span class="va">penguins</span>, <span class="va">bill_length_mm</span>, <span class="va">flipper_length_mm</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-point-chart-1.png" width="100%"></p>
|
||||
<p><img src="reference/figures/README-example-point-chart-1.png" width="65%"></p>
|
||||
<div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Point chart with grouping colors, greater dot size, some transparency, reversed color palette</span></span>
|
||||
<span><span class="fu"><a href="reference/point.html">point</a></span><span class="op">(</span><span class="va">penguins</span>, <span class="va">bill_length_mm</span>, <span class="va">flipper_length_mm</span>, <span class="va">island</span>, alpha <span class="op">=</span> <span class="fl">0.6</span>, size <span class="op">=</span> <span class="fl">3</span>, theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>reverse <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-point-chart-2.png" width="100%"></p>
|
||||
<p><img src="reference/figures/README-example-point-chart-2.png" width="65%"></p>
|
||||
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Using another color palettes</span></span>
|
||||
<span><span class="fu"><a href="reference/point.html">point</a></span><span class="op">(</span><span class="va">penguins</span>, <span class="va">bill_length_mm</span>, <span class="va">flipper_length_mm</span>, <span class="va">island</span>, size <span class="op">=</span> <span class="fl">1.5</span>, x_title <span class="op">=</span> <span class="st">"Bill"</span>, y_title <span class="op">=</span> <span class="st">"Flipper"</span>, title <span class="op">=</span> <span class="st">"Length (mm)"</span>, theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>palette <span class="op">=</span> <span class="st">"artichoke_3"</span>, text_font_face <span class="op">=</span> , grid_x <span class="op">=</span> <span class="cn">T</span>, title_position_to_plot <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-point-chart-3.png" width="100%"></p>
|
||||
<span><span class="fu"><a href="reference/point.html">point</a></span><span class="op">(</span><span class="va">penguins</span>, <span class="va">bill_length_mm</span>, <span class="va">flipper_length_mm</span>, <span class="va">island</span>, size <span class="op">=</span> <span class="fl">1.5</span>, x_title <span class="op">=</span> <span class="st">"Bill"</span>, y_title <span class="op">=</span> <span class="st">"Flipper"</span>, title <span class="op">=</span> <span class="st">"Length (mm)"</span>, theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>palette <span class="op">=</span> <span class="st">"artichoke_3"</span>, text_font_face <span class="op">=</span> , grid_major_x <span class="op">=</span> <span class="cn">TRUE</span>, title_position_to_plot <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-point-chart-3.png" width="65%"></p>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
<h3 id="example-3-dumbbell-plot-reach-themed">Example 3! Dumbbell plot, REACH themed<a class="anchor" aria-label="anchor" href="#example-3-dumbbell-plot-reach-themed"></a>
|
||||
<h3 id="example-3-dumbbell-plot-reach-themed">Example 3: Dumbbell plot, REACH themed<a class="anchor" aria-label="anchor" href="#example-3-dumbbell-plot-reach-themed"></a>
|
||||
</h3>
|
||||
<p>Remember to ensure that your data are in the long format and you only have two groups on the x-axis; for instance, IDP and returnee and no NA values.</p>
|
||||
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Prepare long data</span></span>
|
||||
<span><span class="va">df</span> <span class="op"><-</span> <span class="fu">tibble</span><span class="fu">::</span><span class="fu"><a href="https://tibble.tidyverse.org/reference/tibble.html" class="external-link">tibble</a></span><span class="op">(</span></span>
|
||||
<span> admin1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"A"</span>, <span class="st">"B"</span>, <span class="st">"C"</span>, <span class="st">"D"</span>, <span class="st">"E"</span>, <span class="st">"F"</span>, <span class="st">"G"</span>, <span class="st">"H"</span><span class="op">)</span>, <span class="fl">2</span><span class="op">)</span>,</span>
|
||||
<span> admin1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="va">letters</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">8</span><span class="op">]</span>, <span class="fl">2</span><span class="op">)</span>,</span>
|
||||
<span> setting <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Rural"</span>, <span class="st">"Urban"</span><span class="op">)</span>, <span class="fl">4</span><span class="op">)</span>, <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Urban"</span>, <span class="st">"Rural"</span><span class="op">)</span>, <span class="fl">4</span><span class="op">)</span><span class="op">)</span>,</span>
|
||||
<span> stat <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">16</span>, mean <span class="op">=</span> <span class="fl">50</span>, sd <span class="op">=</span> <span class="fl">18</span><span class="op">)</span></span>
|
||||
<span><span class="op">)</span> <span class="op">|></span></span>
|
||||
<span> <span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html" class="external-link">mutate</a></span><span class="op">(</span>stat <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Round.html" class="external-link">round</a></span><span class="op">(</span><span class="va">stat</span>, <span class="fl">0</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># Example</span></span>
|
||||
<span><span class="co"># Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title</span></span>
|
||||
<span><span class="fu"><a href="reference/dumbbell.html">dumbbell</a></span><span class="op">(</span><span class="va">df</span>,</span>
|
||||
<span> <span class="va">stat</span>,</span>
|
||||
<span> <span class="va">setting</span>,</span>
|
||||
<span> <span class="va">admin1</span>,</span>
|
||||
<span> title <span class="op">=</span> <span class="st">"% of HHs that reported open defecation as sanitation facility"</span>,</span>
|
||||
<span> group_y_title <span class="op">=</span> <span class="st">"Admin 1"</span>,</span>
|
||||
<span> group_x_title <span class="op">=</span> <span class="st">"Setting"</span>,</span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>legend_position <span class="op">=</span> <span class="st">"bottom"</span>,</span>
|
||||
<span> legend_direction <span class="op">=</span> <span class="st">"horizontal"</span>,</span>
|
||||
<span> legend_title_font_face <span class="op">=</span> <span class="st">"bold"</span>,</span>
|
||||
<span> palette <span class="op">=</span> <span class="st">"primary"</span>,</span>
|
||||
<span> title_position_to_plot <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-dumbbell-plot-1.png" width="100%"></p>
|
||||
<span> title_position_to_plot <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> legend.title.align <span class="op">=</span> <span class="fl">0.5</span><span class="op">)</span><span class="op">)</span> <span class="op">+</span></span>
|
||||
<span> <span class="co"># Change legend title position (could be included as part of the function)</span></span>
|
||||
<span> <span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/guides.html" class="external-link">guides</a></span><span class="op">(</span> </span>
|
||||
<span> color <span class="op">=</span> <span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/guide_legend.html" class="external-link">guide_legend</a></span><span class="op">(</span>title.position <span class="op">=</span> <span class="st">"left"</span><span class="op">)</span>,</span>
|
||||
<span> fill <span class="op">=</span> <span class="fu">ggplot2</span><span class="fu">::</span><span class="fu"><a href="https://ggplot2.tidyverse.org/reference/guide_legend.html" class="external-link">guide_legend</a></span><span class="op">(</span>title.position <span class="op">=</span> <span class="st">"left"</span><span class="op">)</span></span>
|
||||
<span> <span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-dumbbell-plot-1.png" width="65%"></p>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
<h3 id="example-4-donut-chart-reach-themed-to-used-moderately">Example 4: donut chart, REACH themed (to used moderately)<a class="anchor" aria-label="anchor" href="#example-4-donut-chart-reach-themed-to-used-moderately"></a>
|
||||
</h3>
|
||||
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Some summarized data: % of HHs by displacement status</span></span>
|
||||
<span><span class="va">df</span> <span class="op"><-</span> <span class="fu">tibble</span><span class="fu">::</span><span class="fu"><a href="https://tibble.tidyverse.org/reference/tibble.html" class="external-link">tibble</a></span><span class="op">(</span></span>
|
||||
<span> status <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Displaced"</span>, <span class="st">"Non displaced"</span>, <span class="st">"Returnee"</span>, <span class="st">"Don't know/Prefer not to say"</span><span class="op">)</span>,</span>
|
||||
<span> percentage <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">18</span>, <span class="fl">65</span>, <span class="fl">12</span>, <span class="fl">3</span><span class="op">)</span></span>
|
||||
<span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># Donut</span></span>
|
||||
<span><span class="fu"><a href="reference/donut.html">donut</a></span><span class="op">(</span><span class="va">df</span>, </span>
|
||||
<span> <span class="va">status</span>, </span>
|
||||
<span> <span class="va">percentage</span>, </span>
|
||||
<span> hole_size <span class="op">=</span> <span class="fl">3</span>, </span>
|
||||
<span> add_text_suffix <span class="op">=</span> <span class="st">"%"</span>, </span>
|
||||
<span> add_text_color <span class="op">=</span> <span class="fu"><a href="reference/cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"dk_grey"</span><span class="op">)</span>, </span>
|
||||
<span> add_text_treshold_display <span class="op">=</span> <span class="fl">5</span>,</span>
|
||||
<span> x_title <span class="op">=</span> <span class="st">"Displacement status"</span>, </span>
|
||||
<span> title <span class="op">=</span> <span class="st">"% of HHs by displacement status"</span>, </span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>legend_reverse <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-donut-plot-1.png" width="65%"></p>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
<h3 id="example-5-alluvial-chart-reach-themed">Example 5: alluvial chart, REACH themed<a class="anchor" aria-label="anchor" href="#example-5-alluvial-chart-reach-themed"></a>
|
||||
</h3>
|
||||
<div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Some summarized data: % of HHs by self-reported status of displacement in 2021 and in 2022</span></span>
|
||||
<span><span class="va">df</span> <span class="op"><-</span> <span class="fu">tibble</span><span class="fu">::</span><span class="fu"><a href="https://tibble.tidyverse.org/reference/tibble.html" class="external-link">tibble</a></span><span class="op">(</span></span>
|
||||
<span> status_from <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="st">"Displaced"</span>, <span class="fl">4</span><span class="op">)</span>,</span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="st">"Non displaced"</span>, <span class="fl">4</span><span class="op">)</span>,</span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="st">"Returnee"</span>, <span class="fl">4</span><span class="op">)</span>,</span>
|
||||
<span> <span class="fu"><a href="https://rdrr.io/r/base/rep.html" class="external-link">rep</a></span><span class="op">(</span><span class="st">"Dnk/Pnts"</span>, <span class="fl">4</span><span class="op">)</span><span class="op">)</span>,</span>
|
||||
<span> status_to <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Displaced"</span>, <span class="st">"Non displaced"</span>, <span class="st">"Returnee"</span>, <span class="st">"Dnk/Pnts"</span>, <span class="st">"Displaced"</span>, <span class="st">"Non displaced"</span>, <span class="st">"Returnee"</span>, <span class="st">"Dnk/Pnts"</span>, <span class="st">"Displaced"</span>, <span class="st">"Non displaced"</span>, <span class="st">"Returnee"</span>, <span class="st">"Dnk/Pnts"</span>, <span class="st">"Displaced"</span>, <span class="st">"Non displaced"</span>, <span class="st">"Returnee"</span>, <span class="st">"Dnk/Pnts"</span><span class="op">)</span>,</span>
|
||||
<span> percentage <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">20</span>, <span class="fl">8</span>, <span class="fl">18</span>, <span class="fl">1</span>, <span class="fl">12</span>, <span class="fl">21</span>, <span class="fl">0</span>, <span class="fl">2</span>, <span class="fl">0</span>, <span class="fl">3</span>, <span class="fl">12</span>, <span class="fl">1</span>, <span class="fl">0</span>, <span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">1</span><span class="op">)</span></span>
|
||||
<span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># Alluvial, here the group is the status for 2021</span></span>
|
||||
<span></span>
|
||||
<span><span class="fu"><a href="reference/alluvial.html">alluvial</a></span><span class="op">(</span><span class="va">df</span>, </span>
|
||||
<span> <span class="va">status_from</span>, </span>
|
||||
<span> <span class="va">status_to</span>,</span>
|
||||
<span> <span class="va">percentage</span>, </span>
|
||||
<span> <span class="va">status_from</span>,</span>
|
||||
<span> from_levels <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"Displaced"</span>, <span class="st">"Non displaced"</span>, <span class="st">"Returnee"</span>, <span class="st">"Dnk/Pnts"</span><span class="op">)</span>, </span>
|
||||
<span> alpha <span class="op">=</span> <span class="fl">0.8</span>, </span>
|
||||
<span> group_title <span class="op">=</span> <span class="st">"Status for 2021"</span>,</span>
|
||||
<span> title <span class="op">=</span> <span class="st">"% of HHs by self-reported status from 2021 to 2022"</span>, </span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span></span>
|
||||
<span> axis_y <span class="op">=</span> <span class="cn">FALSE</span>, </span>
|
||||
<span> legend_position <span class="op">=</span> <span class="st">"none"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-alluvial-plot-1.png" width="65%"></p>
|
||||
</div>
|
||||
<div class="section level3">
|
||||
<h3 id="example-6-lollipop-chart">Example 6: lollipop chart<a class="anchor" aria-label="anchor" href="#example-6-lollipop-chart"></a>
|
||||
</h3>
|
||||
<div class="sourceCode" id="cb12"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://tidyr.tidyverse.org" class="external-link">tidyr</a></span><span class="op">)</span></span>
|
||||
<span><span class="co"># Prepare long data</span></span>
|
||||
<span><span class="va">df</span> <span class="op"><-</span> <span class="fu">tibble</span><span class="fu">::</span><span class="fu"><a href="https://tibble.tidyverse.org/reference/tibble.html" class="external-link">tibble</a></span><span class="op">(</span></span>
|
||||
<span> admin1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/lapply.html" class="external-link">replicate</a></span><span class="op">(</span><span class="fl">15</span>, <span class="fu"><a href="https://rdrr.io/r/base/sample.html" class="external-link">sample</a></span><span class="op">(</span><span class="va">letters</span>, <span class="fl">8</span><span class="op">)</span><span class="op">)</span> <span class="op">|></span> <span class="fu"><a href="https://rdrr.io/r/base/t.html" class="external-link">t</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|></span> <span class="fu"><a href="https://rdrr.io/r/base/as.data.frame.html" class="external-link">as.data.frame</a></span><span class="op">(</span><span class="op">)</span> <span class="op">|></span> <span class="fu"><a href="https://tidyr.tidyverse.org/reference/unite.html" class="external-link">unite</a></span><span class="op">(</span><span class="st">"admin1"</span>, sep <span class="op">=</span> <span class="st">""</span><span class="op">)</span> <span class="op">|></span> <span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/pull.html" class="external-link">pull</a></span><span class="op">(</span><span class="va">admin1</span><span class="op">)</span>, </span>
|
||||
<span> stat <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/stats/Normal.html" class="external-link">rnorm</a></span><span class="op">(</span><span class="fl">15</span>, mean <span class="op">=</span> <span class="fl">50</span>, sd <span class="op">=</span> <span class="fl">15</span><span class="op">)</span><span class="op">)</span> <span class="op">|></span></span>
|
||||
<span> <span class="fu">dplyr</span><span class="fu">::</span><span class="fu"><a href="https://dplyr.tidyverse.org/reference/mutate.html" class="external-link">mutate</a></span><span class="op">(</span>stat <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Round.html" class="external-link">round</a></span><span class="op">(</span><span class="va">stat</span>, <span class="fl">0</span><span class="op">)</span><span class="op">)</span></span>
|
||||
<span></span>
|
||||
<span><span class="co"># Make lollipop plot, REACH themed, vertical with 45 degrees angle X-labels</span></span>
|
||||
<span><span class="fu"><a href="reference/lollipop.html">lollipop</a></span><span class="op">(</span><span class="va">df</span>,</span>
|
||||
<span> <span class="va">admin1</span>,</span>
|
||||
<span> <span class="va">stat</span>,</span>
|
||||
<span> arrange <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> add_text <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> flip <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> y_title <span class="op">=</span> <span class="st">"% of HHs"</span>,</span>
|
||||
<span> x_title <span class="op">=</span> <span class="st">"Admin 1"</span>,</span>
|
||||
<span> title <span class="op">=</span> <span class="st">"% of HHs that reported having received a humanitarian assistance"</span>,</span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>axis_text_x_angle <span class="op">=</span> <span class="fl">45</span>, </span>
|
||||
<span> grid_major_y <span class="op">=</span> <span class="cn">TRUE</span>, </span>
|
||||
<span> grid_major_y_size <span class="op">=</span> <span class="fl">0.2</span>, </span>
|
||||
<span> grid_major_x <span class="op">=</span> <span class="cn">TRUE</span>, </span>
|
||||
<span> grid_minor_y <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-lollipop-chart-1.png" width="65%"></p>
|
||||
<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Horizontal, greater point size, arranged by value, no grid, and text labels added</span></span>
|
||||
<span><span class="fu"><a href="reference/lollipop.html">lollipop</a></span><span class="op">(</span><span class="va">df</span>,</span>
|
||||
<span> <span class="va">admin1</span>,</span>
|
||||
<span> <span class="va">stat</span>,</span>
|
||||
<span> arrange <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> point_size <span class="op">=</span> <span class="fl">10</span>,</span>
|
||||
<span> point_color <span class="op">=</span> <span class="fu"><a href="reference/cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_beige"</span><span class="op">)</span>,</span>
|
||||
<span> segment_size <span class="op">=</span> <span class="fl">2</span>,</span>
|
||||
<span> add_text <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> add_text_suffix <span class="op">=</span> <span class="st">"%"</span>,</span>
|
||||
<span> y_title <span class="op">=</span> <span class="st">"% of HHs"</span>,</span>
|
||||
<span> x_title <span class="op">=</span> <span class="st">"Admin 1"</span>,</span>
|
||||
<span> title <span class="op">=</span> <span class="st">"% of HHs that reported having received a humanitarian assistance in the 12 months prior to the assessment"</span>,</span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="reference/theme_reach.html">theme_reach</a></span><span class="op">(</span>title_position_to_plot <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
|
||||
<p><img src="reference/figures/README-example-lollipop-chart-2.png" width="65%"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section level2">
|
||||
<h2 id="maps">Maps<a class="anchor" aria-label="anchor" href="#maps"></a>
|
||||
</h2>
|
||||
<div class="sourceCode" id="cb10"><pre class="downlit sourceCode r">
|
||||
<div class="sourceCode" id="cb14"><pre class="downlit sourceCode r">
|
||||
<code class="sourceCode R"><span><span class="co"># Add indicator layer </span></span>
|
||||
<span><span class="co"># - based on "pretty" classes and title "Proportion (%)" </span></span>
|
||||
<span><span class="co"># - buffer to add a 10% around the bounding box</span></span>
|
||||
|
|
|
|||
|
|
@ -47,8 +47,13 @@
|
|||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="0.6.9000" id="visualizer-069000">visualizeR 0.6.9000<a class="anchor" aria-label="anchor" href="#visualizer-069000"></a></h2>
|
||||
<ul><li>Add <code><a href="../reference/dumbbell.html">dumbbell()</a></code>.</li>
|
||||
<li>Add further parameters to <code><a href="../reference/theme_reach.html">theme_reach()</a></code>
|
||||
<li>Add <code><a href="../reference/alluvial.html">alluvial()</a></code>
|
||||
</li>
|
||||
<li>Add <code><a href="../reference/donut.html">donut()</a></code>
|
||||
</li>
|
||||
<li>Add <code><a href="../reference/lollipop.html">lollipop()</a></code>
|
||||
</li>
|
||||
<li>Add further parameters to <code><a href="../reference/theme_reach.html">theme_reach()</a></code>, including grid lines args.</li>
|
||||
</ul><hr></div>
|
||||
<div class="section level2">
|
||||
<h2 class="pkg-version" data-toc-text="0.5.9000" id="visualizer-059000">visualizeR 0.5.9000<a class="anchor" aria-label="anchor" href="#visualizer-059000"></a></h2>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ pandoc: 2.14.0.3
|
|||
pkgdown: 2.0.7
|
||||
pkgdown_sha: ~
|
||||
articles: {}
|
||||
last_built: 2022-12-24T23:19Z
|
||||
last_built: 2023-01-25T00:40Z
|
||||
urls:
|
||||
reference: https://gnoblet.github.io/visualizeR/reference
|
||||
article: https://gnoblet.github.io/visualizeR/articles
|
||||
|
|
|
|||
166
docs/reference/alluvial.html
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
<!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="Simple alluvial chart"><title>Simple alluvial chart — alluvial • 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.2.2/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.2.2/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.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></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 alluvial chart — alluvial"><meta property="og:description" content="Simple alluvial 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>
|
||||
<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.6.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 alluvial chart</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/gnoblet/visualizeR/blob/HEAD/R/alluvial.R" class="external-link"><code>R/alluvial.R</code></a></small>
|
||||
<div class="d-none name"><code>alluvial.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Simple alluvial chart</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">alluvial</span><span class="op">(</span></span>
|
||||
<span> <span class="va">df</span>,</span>
|
||||
<span> <span class="va">from</span>,</span>
|
||||
<span> <span class="va">to</span>,</span>
|
||||
<span> <span class="va">value</span>,</span>
|
||||
<span> group <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> alpha <span class="op">=</span> <span class="fl">0.5</span>,</span>
|
||||
<span> from_levels <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> value_title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> group_title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> subtitle <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> caption <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> rect_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"white"</span><span class="op">)</span>,</span>
|
||||
<span> rect_border_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_grey"</span><span class="op">)</span>,</span>
|
||||
<span> rect_text_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_grey"</span><span class="op">)</span>,</span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="theme_reach.html">theme_reach</a></span><span class="op">(</span>axis_y <span class="op">=</span> <span class="cn">FALSE</span>, legend_position <span class="op">=</span> <span class="st">"none"</span><span class="op">)</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>df</dt>
|
||||
<dd><p>A data frame.</p></dd>
|
||||
|
||||
|
||||
<dt>from</dt>
|
||||
<dd><p>A character column of upstream stratum.</p></dd>
|
||||
|
||||
|
||||
<dt>to</dt>
|
||||
<dd><p>A character column of downstream stratum.</p></dd>
|
||||
|
||||
|
||||
<dt>value</dt>
|
||||
<dd><p>A numeric column of values.</p></dd>
|
||||
|
||||
|
||||
<dt>group</dt>
|
||||
<dd><p>The grouping column to fill the alluvium with.</p></dd>
|
||||
|
||||
|
||||
<dt>alpha</dt>
|
||||
<dd><p>Fill transparency. Default to 0.5.</p></dd>
|
||||
|
||||
|
||||
<dt>from_levels</dt>
|
||||
<dd><p>Order by given from levels?</p></dd>
|
||||
|
||||
|
||||
<dt>value_title</dt>
|
||||
<dd><p>The value/y scale title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>group_title</dt>
|
||||
<dd><p>The group title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>title</dt>
|
||||
<dd><p>Plot title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>subtitle</dt>
|
||||
<dd><p>Plot subtitle. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>caption</dt>
|
||||
<dd><p>Plot caption. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>rect_color</dt>
|
||||
<dd><p>Stratum rectangles' fill color.</p></dd>
|
||||
|
||||
|
||||
<dt>rect_border_color</dt>
|
||||
<dd><p>Stratum rectangles' border color.</p></dd>
|
||||
|
||||
|
||||
<dt>rect_text_color</dt>
|
||||
<dd><p>Stratum rectangles' text color.</p></dd>
|
||||
|
||||
|
||||
<dt>theme</dt>
|
||||
<dd><p>Whatever theme. Default to theme_reach().</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
||||
|
||||
<p>A donut chart to be used parsimoniously</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.7.</p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
||||
161
docs/reference/donut.html
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<!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="Simple donut chart (to be used parsimoniously), can be a pie chart"><title>Simple donut chart (to be used parsimoniously), can be a pie chart — donut • 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.2.2/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.2.2/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.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></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 donut chart (to be used parsimoniously), can be a pie chart — donut"><meta property="og:description" content="Simple donut chart (to be used parsimoniously), can be a pie 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>
|
||||
<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.6.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 donut chart (to be used parsimoniously), can be a pie chart</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/gnoblet/visualizeR/blob/HEAD/R/donut.R" class="external-link"><code>R/donut.R</code></a></small>
|
||||
<div class="d-none name"><code>donut.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Simple donut chart (to be used parsimoniously), can be a pie chart</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">donut</span><span class="op">(</span></span>
|
||||
<span> <span class="va">df</span>,</span>
|
||||
<span> <span class="va">x</span>,</span>
|
||||
<span> <span class="va">y</span>,</span>
|
||||
<span> alpha <span class="op">=</span> <span class="fl">1</span>,</span>
|
||||
<span> x_title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> subtitle <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> caption <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> arrange <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> hole_size <span class="op">=</span> <span class="fl">3</span>,</span>
|
||||
<span> add_text <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> add_text_treshold_display <span class="op">=</span> <span class="fl">5</span>,</span>
|
||||
<span> add_text_color <span class="op">=</span> <span class="st">"white"</span>,</span>
|
||||
<span> add_text_suffix <span class="op">=</span> <span class="st">""</span>,</span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="theme_reach.html">theme_reach</a></span><span class="op">(</span>legend_reverse <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</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>df</dt>
|
||||
<dd><p>A data frame.</p></dd>
|
||||
|
||||
|
||||
<dt>x</dt>
|
||||
<dd><p>A character column or coercible as a character column. Will give the donut's fill color.</p></dd>
|
||||
|
||||
|
||||
<dt>y</dt>
|
||||
<dd><p>A numeric column.</p></dd>
|
||||
|
||||
|
||||
<dt>alpha</dt>
|
||||
<dd><p>Fill transparency.</p></dd>
|
||||
|
||||
|
||||
<dt>x_title</dt>
|
||||
<dd><p>The x scale title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>title</dt>
|
||||
<dd><p>Plot title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>subtitle</dt>
|
||||
<dd><p>Plot subtitle. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>caption</dt>
|
||||
<dd><p>Plot caption. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>arrange</dt>
|
||||
<dd><p>TRUE or FALSE. Arrange by highest percentage first.</p></dd>
|
||||
|
||||
|
||||
<dt>hole_size</dt>
|
||||
<dd><p>Hole size. Default to 3. If less than 2, back to a pie chart.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text</dt>
|
||||
<dd><p>TRUE or FALSE. Add the value as text.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text_treshold_display</dt>
|
||||
<dd><p>Minimum value to add the text label.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text_color</dt>
|
||||
<dd><p>Text color.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text_suffix</dt>
|
||||
<dd><p>If percent is FALSE, should we add a suffix to the text label?</p></dd>
|
||||
|
||||
|
||||
<dt>theme</dt>
|
||||
<dd><p>Whatever theme. Default to theme_reach().</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
||||
|
||||
<p>A donut chart to be used parsimoniously</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.7.</p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
||||
BIN
docs/reference/figures/README-example-alluvial-plot-1.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 58 KiB |
BIN
docs/reference/figures/README-example-donut-plot-1.png
Normal file
|
After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 109 KiB |
BIN
docs/reference/figures/README-example-lollipop-chart-1.png
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
docs/reference/figures/README-example-lollipop-chart-2.png
Normal file
|
After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 166 KiB |
|
|
@ -96,6 +96,11 @@
|
|||
<dd>Add a scale bar</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="alluvial.html">alluvial()</a></code>
|
||||
</dt>
|
||||
<dd>Simple alluvial chart</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="bar.html">bar()</a></code>
|
||||
</dt>
|
||||
<dd>Simple bar chart</dd>
|
||||
|
|
@ -131,6 +136,11 @@
|
|||
<dd>Function to extract REACH colors as hex codes</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="donut.html">donut()</a></code>
|
||||
</dt>
|
||||
<dd>Simple donut chart (to be used parsimoniously), can be a pie chart</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="dumbbell.html">dumbbell()</a></code>
|
||||
</dt>
|
||||
<dd>Make dumbbell chart.</dd>
|
||||
|
|
@ -161,6 +171,11 @@
|
|||
<dd>Haïti admin 1 lines shapefile.</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="lollipop.html">lollipop()</a></code>
|
||||
</dt>
|
||||
<dd>Simple bar chart</dd>
|
||||
</dl><dl><dt>
|
||||
|
||||
<code><a href="pal_agora.html">pal_agora()</a></code>
|
||||
</dt>
|
||||
<dd>Return function to interpolate an AGORA color palette</dd>
|
||||
|
|
|
|||
206
docs/reference/lollipop.html
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
<!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="Simple bar chart"><title>Simple bar chart — lollipop • 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.2.2/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.2.2/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.jsdelivr.net/gh/afeld/bootstrap-toc@v1.0.1/dist/bootstrap-toc.min.js" integrity="sha256-4veVQbu7//Lk5TSmc7YV48MxtMy98e26cf5MrgZYnwo=" crossorigin="anonymous"></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 bar chart — lollipop"><meta property="og:description" content="Simple 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>
|
||||
<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.6.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 bar chart</h1>
|
||||
<small class="dont-index">Source: <a href="https://github.com/gnoblet/visualizeR/blob/HEAD/R/lollipop.R" class="external-link"><code>R/lollipop.R</code></a></small>
|
||||
<div class="d-none name"><code>lollipop.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description section level2">
|
||||
<p>Simple bar chart</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">lollipop</span><span class="op">(</span></span>
|
||||
<span> <span class="va">df</span>,</span>
|
||||
<span> <span class="va">x</span>,</span>
|
||||
<span> <span class="va">y</span>,</span>
|
||||
<span> flip <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> wrap <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> arrange <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> point_size <span class="op">=</span> <span class="fl">3</span>,</span>
|
||||
<span> point_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_red"</span><span class="op">)</span>,</span>
|
||||
<span> point_alpha <span class="op">=</span> <span class="fl">1</span>,</span>
|
||||
<span> segment_size <span class="op">=</span> <span class="fl">1</span>,</span>
|
||||
<span> segment_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_grey"</span><span class="op">)</span>,</span>
|
||||
<span> segment_alpha <span class="op">=</span> <span class="fl">1</span>,</span>
|
||||
<span> alpha <span class="op">=</span> <span class="fl">1</span>,</span>
|
||||
<span> x_title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> y_title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> title <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> subtitle <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> caption <span class="op">=</span> <span class="cn">NULL</span>,</span>
|
||||
<span> add_text <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> add_text_size <span class="op">=</span> <span class="fl">3</span>,</span>
|
||||
<span> add_text_suffix <span class="op">=</span> <span class="st">""</span>,</span>
|
||||
<span> add_text_color <span class="op">=</span> <span class="st">"white"</span>,</span>
|
||||
<span> add_text_fontface <span class="op">=</span> <span class="st">"bold"</span>,</span>
|
||||
<span> theme <span class="op">=</span> <span class="fu"><a href="theme_reach.html">theme_reach</a></span><span class="op">(</span><span class="op">)</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>df</dt>
|
||||
<dd><p>A data frame.</p></dd>
|
||||
|
||||
|
||||
<dt>x</dt>
|
||||
<dd><p>A numeric column.</p></dd>
|
||||
|
||||
|
||||
<dt>y</dt>
|
||||
<dd><p>A character column or coercible as a character column.</p></dd>
|
||||
|
||||
|
||||
<dt>flip</dt>
|
||||
<dd><p>TRUE or FALSE. Default to TRUE or horizontal lollipop plot.</p></dd>
|
||||
|
||||
|
||||
<dt>wrap</dt>
|
||||
<dd><p>Should x-labels be wrapped? Number of characters.</p></dd>
|
||||
|
||||
|
||||
<dt>arrange</dt>
|
||||
<dd><p>TRUE or FALSE. Arrange by highest percentage first.</p></dd>
|
||||
|
||||
|
||||
<dt>point_size</dt>
|
||||
<dd><p>Point size.</p></dd>
|
||||
|
||||
|
||||
<dt>point_color</dt>
|
||||
<dd><p>Point color.</p></dd>
|
||||
|
||||
|
||||
<dt>point_alpha</dt>
|
||||
<dd><p>Point alpha.</p></dd>
|
||||
|
||||
|
||||
<dt>segment_size</dt>
|
||||
<dd><p>Segment size.</p></dd>
|
||||
|
||||
|
||||
<dt>segment_color</dt>
|
||||
<dd><p>Segment color.</p></dd>
|
||||
|
||||
|
||||
<dt>segment_alpha</dt>
|
||||
<dd><p>Segment alpha.</p></dd>
|
||||
|
||||
|
||||
<dt>alpha</dt>
|
||||
<dd><p>Fill transparency.</p></dd>
|
||||
|
||||
|
||||
<dt>x_title</dt>
|
||||
<dd><p>The x scale title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>y_title</dt>
|
||||
<dd><p>The y scale title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>title</dt>
|
||||
<dd><p>Plot title. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>subtitle</dt>
|
||||
<dd><p>Plot subtitle. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>caption</dt>
|
||||
<dd><p>Plot caption. Default to NULL.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text</dt>
|
||||
<dd><p>TRUE or FALSE. Add the y value as text within the bubble.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text_size</dt>
|
||||
<dd><p>Text size.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text_suffix</dt>
|
||||
<dd><p>If percent is FALSE, should we add a suffix to the text label?</p></dd>
|
||||
|
||||
|
||||
<dt>add_text_color</dt>
|
||||
<dd><p>Added text color. Default to white.</p></dd>
|
||||
|
||||
|
||||
<dt>add_text_fontface</dt>
|
||||
<dd><p>Added text font face. Default to "bold".</p></dd>
|
||||
|
||||
|
||||
<dt>theme</dt>
|
||||
<dd><p>Whatever theme. Default to theme_reach().</p></dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section level2">
|
||||
<h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
|
||||
|
||||
|
||||
<p>A 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.7.</p>
|
||||
</div>
|
||||
|
||||
</footer></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
<span> palette <span class="op">=</span> <span class="st">"main"</span>,</span>
|
||||
<span> discrete <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> font_family <span class="op">=</span> <span class="st">"Leelawadee"</span>,</span>
|
||||
<span> font_family <span class="op">=</span> <span class="st">"Segoe UI"</span>,</span>
|
||||
<span> title_size <span class="op">=</span> <span class="fl">12</span>,</span>
|
||||
<span> title_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_grey"</span><span class="op">)</span>,</span>
|
||||
<span> title_font_face <span class="op">=</span> <span class="st">"bold"</span>,</span>
|
||||
|
|
@ -81,11 +81,19 @@
|
|||
<span> axis_title_size <span class="op">=</span> <span class="fl">11</span>,</span>
|
||||
<span> axis_title_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_grey"</span><span class="op">)</span>,</span>
|
||||
<span> axis_title_font_face <span class="op">=</span> <span class="st">"bold"</span>,</span>
|
||||
<span> grid_x <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> grid_y <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> grid_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_lt_grey"</span><span class="op">)</span>,</span>
|
||||
<span> grid_x_size <span class="op">=</span> <span class="fl">0.1</span>,</span>
|
||||
<span> grid_y_size <span class="op">=</span> <span class="fl">0.1</span>,</span>
|
||||
<span> axis_text_x_angle <span class="op">=</span> <span class="fl">0</span>,</span>
|
||||
<span> axis_text_x_vjust <span class="op">=</span> <span class="fl">0.5</span>,</span>
|
||||
<span> axis_text_x_hjust <span class="op">=</span> <span class="fl">0.5</span>,</span>
|
||||
<span> grid_major_x <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> grid_major_y <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> grid_major_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_lt_grey"</span><span class="op">)</span>,</span>
|
||||
<span> grid_major_x_size <span class="op">=</span> <span class="fl">0.1</span>,</span>
|
||||
<span> grid_major_y_size <span class="op">=</span> <span class="fl">0.1</span>,</span>
|
||||
<span> grid_minor_x <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> grid_minor_y <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||
<span> grid_minor_color <span class="op">=</span> <span class="fu"><a href="cols_reach.html">cols_reach</a></span><span class="op">(</span><span class="st">"main_lt_grey"</span><span class="op">)</span>,</span>
|
||||
<span> grid_minor_x_size <span class="op">=</span> <span class="fl">0.05</span>,</span>
|
||||
<span> grid_minor_y_size <span class="op">=</span> <span class="fl">0.05</span>,</span>
|
||||
<span> caption_position_to_plot <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||
<span> <span class="va">...</span></span>
|
||||
<span><span class="op">)</span></span></code></pre></div>
|
||||
|
|
@ -209,24 +217,44 @@
|
|||
<dd><p>Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").</p></dd>
|
||||
|
||||
|
||||
<dt>grid_x</dt>
|
||||
<dt>grid_major_x</dt>
|
||||
<dd><p>Boolean. Do you need major grid lines for x-axis?</p></dd>
|
||||
|
||||
|
||||
<dt>grid_y</dt>
|
||||
<dt>grid_major_y</dt>
|
||||
<dd><p>Boolean. Do you need major grid lines for y-axis?</p></dd>
|
||||
|
||||
|
||||
<dt>grid_color</dt>
|
||||
<dd><p>Grid lines color.</p></dd>
|
||||
<dt>grid_major_color</dt>
|
||||
<dd><p>Major grid lines color.</p></dd>
|
||||
|
||||
|
||||
<dt>grid_x_size</dt>
|
||||
<dd><p>X line size.</p></dd>
|
||||
<dt>grid_major_x_size</dt>
|
||||
<dd><p>Major X line size.</p></dd>
|
||||
|
||||
|
||||
<dt>grid_y_size</dt>
|
||||
<dd><p>Y line size.</p></dd>
|
||||
<dt>grid_major_y_size</dt>
|
||||
<dd><p>Major Y line size.</p></dd>
|
||||
|
||||
|
||||
<dt>grid_minor_x</dt>
|
||||
<dd><p>Boolean. Do you need minor grid lines for x-axis?</p></dd>
|
||||
|
||||
|
||||
<dt>grid_minor_y</dt>
|
||||
<dd><p>Boolean. Do you need minor grid lines for y-axis?</p></dd>
|
||||
|
||||
|
||||
<dt>grid_minor_color</dt>
|
||||
<dd><p>Minor grid lines color.</p></dd>
|
||||
|
||||
|
||||
<dt>grid_minor_x_size</dt>
|
||||
<dd><p>Minor X line size.</p></dd>
|
||||
|
||||
|
||||
<dt>grid_minor_y_size</dt>
|
||||
<dd><p>Minor Y line size.</p></dd>
|
||||
|
||||
|
||||
<dt>caption_position_to_plot</dt>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@
|
|||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/add_scale_bar.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/alluvial.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/bar.html</loc>
|
||||
</url>
|
||||
|
|
@ -60,6 +63,9 @@
|
|||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/cols_reach.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/donut.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/dumbbell.html</loc>
|
||||
</url>
|
||||
|
|
@ -81,6 +87,9 @@
|
|||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/line_admin1.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/lollipop.html</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gnoblet.github.io/visualizeR/reference/pal_agora.html</loc>
|
||||
</url>
|
||||
|
|
|
|||
64
man/alluvial.Rd
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/alluvial.R
|
||||
\name{alluvial}
|
||||
\alias{alluvial}
|
||||
\title{Simple alluvial chart}
|
||||
\usage{
|
||||
alluvial(
|
||||
df,
|
||||
from,
|
||||
to,
|
||||
value,
|
||||
group = NULL,
|
||||
alpha = 0.5,
|
||||
from_levels = NULL,
|
||||
value_title = NULL,
|
||||
group_title = NULL,
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
rect_color = cols_reach("white"),
|
||||
rect_border_color = cols_reach("main_grey"),
|
||||
rect_text_color = cols_reach("main_grey"),
|
||||
theme = theme_reach(axis_y = FALSE, legend_position = "none")
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{df}{A data frame.}
|
||||
|
||||
\item{from}{A character column of upstream stratum.}
|
||||
|
||||
\item{to}{A character column of downstream stratum.}
|
||||
|
||||
\item{value}{A numeric column of values.}
|
||||
|
||||
\item{group}{The grouping column to fill the alluvium with.}
|
||||
|
||||
\item{alpha}{Fill transparency. Default to 0.5.}
|
||||
|
||||
\item{from_levels}{Order by given from levels?}
|
||||
|
||||
\item{value_title}{The value/y scale title. Default to NULL.}
|
||||
|
||||
\item{group_title}{The group title. Default to NULL.}
|
||||
|
||||
\item{title}{Plot title. Default to NULL.}
|
||||
|
||||
\item{subtitle}{Plot subtitle. Default to NULL.}
|
||||
|
||||
\item{caption}{Plot caption. Default to NULL.}
|
||||
|
||||
\item{rect_color}{Stratum rectangles' fill color.}
|
||||
|
||||
\item{rect_border_color}{Stratum rectangles' border color.}
|
||||
|
||||
\item{rect_text_color}{Stratum rectangles' text color.}
|
||||
|
||||
\item{theme}{Whatever theme. Default to theme_reach().}
|
||||
}
|
||||
\value{
|
||||
A donut chart to be used parsimoniously
|
||||
}
|
||||
\description{
|
||||
Simple alluvial chart
|
||||
}
|
||||
61
man/donut.Rd
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/donut.R
|
||||
\name{donut}
|
||||
\alias{donut}
|
||||
\title{Simple donut chart (to be used parsimoniously), can be a pie chart}
|
||||
\usage{
|
||||
donut(
|
||||
df,
|
||||
x,
|
||||
y,
|
||||
alpha = 1,
|
||||
x_title = NULL,
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
arrange = TRUE,
|
||||
hole_size = 3,
|
||||
add_text = TRUE,
|
||||
add_text_treshold_display = 5,
|
||||
add_text_color = "white",
|
||||
add_text_suffix = "",
|
||||
theme = theme_reach(legend_reverse = TRUE)
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{df}{A data frame.}
|
||||
|
||||
\item{x}{A character column or coercible as a character column. Will give the donut's fill color.}
|
||||
|
||||
\item{y}{A numeric column.}
|
||||
|
||||
\item{alpha}{Fill transparency.}
|
||||
|
||||
\item{x_title}{The x scale title. Default to NULL.}
|
||||
|
||||
\item{title}{Plot title. Default to NULL.}
|
||||
|
||||
\item{subtitle}{Plot subtitle. Default to NULL.}
|
||||
|
||||
\item{caption}{Plot caption. Default to NULL.}
|
||||
|
||||
\item{arrange}{TRUE or FALSE. Arrange by highest percentage first.}
|
||||
|
||||
\item{hole_size}{Hole size. Default to 3. If less than 2, back to a pie chart.}
|
||||
|
||||
\item{add_text}{TRUE or FALSE. Add the value as text.}
|
||||
|
||||
\item{add_text_treshold_display}{Minimum value to add the text label.}
|
||||
|
||||
\item{add_text_color}{Text color.}
|
||||
|
||||
\item{add_text_suffix}{If percent is FALSE, should we add a suffix to the text label?}
|
||||
|
||||
\item{theme}{Whatever theme. Default to theme_reach().}
|
||||
}
|
||||
\value{
|
||||
A donut chart to be used parsimoniously
|
||||
}
|
||||
\description{
|
||||
Simple donut chart (to be used parsimoniously), can be a pie chart
|
||||
}
|
||||
BIN
man/figures/README-example-alluvial-plot-1.png
Normal file
|
After Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 58 KiB |
BIN
man/figures/README-example-donut-plot-1.png
Normal file
|
After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 109 KiB |
BIN
man/figures/README-example-lollipop-chart-1.png
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
man/figures/README-example-lollipop-chart-2.png
Normal file
|
After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 166 KiB |
88
man/lollipop.Rd
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/lollipop.R
|
||||
\name{lollipop}
|
||||
\alias{lollipop}
|
||||
\title{Simple bar chart}
|
||||
\usage{
|
||||
lollipop(
|
||||
df,
|
||||
x,
|
||||
y,
|
||||
flip = TRUE,
|
||||
wrap = NULL,
|
||||
arrange = TRUE,
|
||||
point_size = 3,
|
||||
point_color = cols_reach("main_red"),
|
||||
point_alpha = 1,
|
||||
segment_size = 1,
|
||||
segment_color = cols_reach("main_grey"),
|
||||
segment_alpha = 1,
|
||||
alpha = 1,
|
||||
x_title = NULL,
|
||||
y_title = NULL,
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
add_text = FALSE,
|
||||
add_text_size = 3,
|
||||
add_text_suffix = "",
|
||||
add_text_color = "white",
|
||||
add_text_fontface = "bold",
|
||||
theme = theme_reach()
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{df}{A data frame.}
|
||||
|
||||
\item{x}{A numeric column.}
|
||||
|
||||
\item{y}{A character column or coercible as a character column.}
|
||||
|
||||
\item{flip}{TRUE or FALSE. Default to TRUE or horizontal lollipop plot.}
|
||||
|
||||
\item{wrap}{Should x-labels be wrapped? Number of characters.}
|
||||
|
||||
\item{arrange}{TRUE or FALSE. Arrange by highest percentage first.}
|
||||
|
||||
\item{point_size}{Point size.}
|
||||
|
||||
\item{point_color}{Point color.}
|
||||
|
||||
\item{point_alpha}{Point alpha.}
|
||||
|
||||
\item{segment_size}{Segment size.}
|
||||
|
||||
\item{segment_color}{Segment color.}
|
||||
|
||||
\item{segment_alpha}{Segment alpha.}
|
||||
|
||||
\item{alpha}{Fill transparency.}
|
||||
|
||||
\item{x_title}{The x scale title. Default to NULL.}
|
||||
|
||||
\item{y_title}{The y scale title. Default to NULL.}
|
||||
|
||||
\item{title}{Plot title. Default to NULL.}
|
||||
|
||||
\item{subtitle}{Plot subtitle. Default to NULL.}
|
||||
|
||||
\item{caption}{Plot caption. Default to NULL.}
|
||||
|
||||
\item{add_text}{TRUE or FALSE. Add the y value as text within the bubble.}
|
||||
|
||||
\item{add_text_size}{Text size.}
|
||||
|
||||
\item{add_text_suffix}{If percent is FALSE, should we add a suffix to the text label?}
|
||||
|
||||
\item{add_text_color}{Added text color. Default to white.}
|
||||
|
||||
\item{add_text_fontface}{Added text font face. Default to "bold".}
|
||||
|
||||
\item{theme}{Whatever theme. Default to theme_reach().}
|
||||
}
|
||||
\value{
|
||||
A bar chart
|
||||
}
|
||||
\description{
|
||||
Simple bar chart
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ theme_reach(
|
|||
palette = "main",
|
||||
discrete = TRUE,
|
||||
reverse = FALSE,
|
||||
font_family = "Leelawadee",
|
||||
font_family = "Segoe UI",
|
||||
title_size = 12,
|
||||
title_color = cols_reach("main_grey"),
|
||||
title_font_face = "bold",
|
||||
|
|
@ -34,11 +34,19 @@ theme_reach(
|
|||
axis_title_size = 11,
|
||||
axis_title_color = cols_reach("main_grey"),
|
||||
axis_title_font_face = "bold",
|
||||
grid_x = FALSE,
|
||||
grid_y = FALSE,
|
||||
grid_color = cols_reach("main_lt_grey"),
|
||||
grid_x_size = 0.1,
|
||||
grid_y_size = 0.1,
|
||||
axis_text_x_angle = 0,
|
||||
axis_text_x_vjust = 0.5,
|
||||
axis_text_x_hjust = 0.5,
|
||||
grid_major_x = FALSE,
|
||||
grid_major_y = FALSE,
|
||||
grid_major_color = cols_reach("main_lt_grey"),
|
||||
grid_major_x_size = 0.1,
|
||||
grid_major_y_size = 0.1,
|
||||
grid_minor_x = FALSE,
|
||||
grid_minor_y = FALSE,
|
||||
grid_minor_color = cols_reach("main_lt_grey"),
|
||||
grid_minor_x_size = 0.05,
|
||||
grid_minor_y_size = 0.05,
|
||||
caption_position_to_plot = TRUE,
|
||||
...
|
||||
)
|
||||
|
|
@ -102,15 +110,25 @@ theme_reach(
|
|||
|
||||
\item{axis_title_font_face}{Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").}
|
||||
|
||||
\item{grid_x}{Boolean. Do you need major grid lines for x-axis?}
|
||||
\item{grid_major_x}{Boolean. Do you need major grid lines for x-axis?}
|
||||
|
||||
\item{grid_y}{Boolean. Do you need major grid lines for y-axis?}
|
||||
\item{grid_major_y}{Boolean. Do you need major grid lines for y-axis?}
|
||||
|
||||
\item{grid_color}{Grid lines color.}
|
||||
\item{grid_major_color}{Major grid lines color.}
|
||||
|
||||
\item{grid_x_size}{X line size.}
|
||||
\item{grid_major_x_size}{Major X line size.}
|
||||
|
||||
\item{grid_y_size}{Y line size.}
|
||||
\item{grid_major_y_size}{Major Y line size.}
|
||||
|
||||
\item{grid_minor_x}{Boolean. Do you need minor grid lines for x-axis?}
|
||||
|
||||
\item{grid_minor_y}{Boolean. Do you need minor grid lines for y-axis?}
|
||||
|
||||
\item{grid_minor_color}{Minor grid lines color.}
|
||||
|
||||
\item{grid_minor_x_size}{Minor X line size.}
|
||||
|
||||
\item{grid_minor_y_size}{Minor Y line size.}
|
||||
|
||||
\item{caption_position_to_plot}{TRUE or FALSE. Positioning to plot or to panel?}
|
||||
|
||||
|
|
|
|||