|
|
@ -1,7 +1,7 @@
|
||||||
Package: visualizeR
|
Package: visualizeR
|
||||||
Type: Package
|
Type: Package
|
||||||
Title: What a color! What a viz!
|
Title: What a color! What a viz!
|
||||||
Version: 0.6.9000
|
Version: 0.7.9000
|
||||||
Authors@R: c(
|
Authors@R: c(
|
||||||
person(
|
person(
|
||||||
'Noblet', 'Guillaume',
|
'Noblet', 'Guillaume',
|
||||||
|
|
@ -27,6 +27,7 @@ Imports:
|
||||||
ggtext,
|
ggtext,
|
||||||
ggrepel,
|
ggrepel,
|
||||||
tidyr,
|
tidyr,
|
||||||
dplyr
|
dplyr,
|
||||||
|
ggalluvial
|
||||||
Suggests: knitr, sf, tmap
|
Suggests: knitr, sf, tmap
|
||||||
VignetteBuilder: knitr
|
VignetteBuilder: knitr
|
||||||
|
|
|
||||||
12
NEWS.md
|
|
@ -1,7 +1,17 @@
|
||||||
# visualizeR 0.6.9000
|
# visualizeR 0.6.9000
|
||||||
|
|
||||||
* Add `dumbbell()`.
|
* Add `dumbbell()`.
|
||||||
* Add further parameters to `theme_reach()`
|
* Add `alluvial()`
|
||||||
|
* Add `donut()`
|
||||||
|
* Add `lollipop()`
|
||||||
|
* Add further parameters to `theme_reach()`, including grid lines args.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# visualizeR 0.6.9000
|
||||||
|
|
||||||
|
* Add `dumbbell()`.
|
||||||
|
* Add further parameters to `theme_reach()`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
104
R/alluvial.R
Normal file
|
|
@ -0,0 +1,104 @@
|
||||||
|
#' @title Simple alluvial chart
|
||||||
|
#'
|
||||||
|
#' @param df A data frame.
|
||||||
|
#' @param from A character column of upstream stratum.
|
||||||
|
#' @param to A character column of downstream stratum.
|
||||||
|
#' @param value A numeric column of values.
|
||||||
|
#' @param group The grouping column to fill the alluvium with.
|
||||||
|
#' @param alpha Fill transparency. Default to 0.5.
|
||||||
|
#' @param from_levels Order by given from levels?
|
||||||
|
#' @param value_title The value/y scale title. Default to NULL.
|
||||||
|
#' @param group_title The group 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 rect_color Stratum rectangles' fill color.
|
||||||
|
#' @param rect_border_color Stratum rectangles' border color.
|
||||||
|
#' @param rect_text_color Stratum rectangles' text color.
|
||||||
|
#' @param theme Whatever theme. Default to theme_reach().
|
||||||
|
#'
|
||||||
|
#' @return A donut chart to be used parsimoniously
|
||||||
|
#'
|
||||||
|
#' @export
|
||||||
|
alluvial <- function(
|
||||||
|
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")
|
||||||
|
){
|
||||||
|
|
||||||
|
if(!is.null(from_levels)) df <- dplyr::mutate(df, "{{from}}" := factor({{ from }}, levels = from_levels))
|
||||||
|
|
||||||
|
# General mapping
|
||||||
|
g <- ggplot2::ggplot(
|
||||||
|
data = df,
|
||||||
|
mapping = ggplot2::aes(
|
||||||
|
y = {{ value }},
|
||||||
|
axis1 = {{ from }},
|
||||||
|
axis3 = {{ to }}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add alluvium
|
||||||
|
g <- g +
|
||||||
|
ggalluvial::geom_alluvium(
|
||||||
|
ggplot2::aes(
|
||||||
|
fill = {{ group }},
|
||||||
|
color = {{ group }}
|
||||||
|
),
|
||||||
|
alpha = alpha)
|
||||||
|
|
||||||
|
# Add stratum
|
||||||
|
g <- g +
|
||||||
|
ggalluvial::geom_stratum(
|
||||||
|
fill = rect_color,
|
||||||
|
color = rect_border_color
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add stratum text
|
||||||
|
|
||||||
|
stratum <- ggalluvial::StatStratum
|
||||||
|
|
||||||
|
g <- g +
|
||||||
|
ggplot2::geom_text(
|
||||||
|
stat = stratum,
|
||||||
|
ggplot2::aes(label = ggplot2::after_stat(!!rlang::sym("stratum"))),
|
||||||
|
color = cols_reach("main_grey")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Add title, subtitle, caption, x_title, y_title
|
||||||
|
g <- g + ggplot2::labs(
|
||||||
|
y = value_title,
|
||||||
|
title = title,
|
||||||
|
subtitle = subtitle,
|
||||||
|
caption = caption,
|
||||||
|
fill = group_title,
|
||||||
|
color = group_title
|
||||||
|
)
|
||||||
|
|
||||||
|
# Remove x-axis
|
||||||
|
g <- g + ggplot2::theme(
|
||||||
|
axis.line.x = ggplot2::element_blank(),
|
||||||
|
axis.ticks.x = ggplot2::element_blank(),
|
||||||
|
axis.text.x = ggplot2::element_blank(),
|
||||||
|
axis.title.x = ggplot2::element_blank()
|
||||||
|
)
|
||||||
|
|
||||||
|
g <- g + theme
|
||||||
|
|
||||||
|
return(g)
|
||||||
|
}
|
||||||
109
R/donut.R
Normal file
|
|
@ -0,0 +1,109 @@
|
||||||
|
#' @title Simple donut chart (to be used parsimoniously), can be a pie chart
|
||||||
|
#'
|
||||||
|
#' @param df A data frame.
|
||||||
|
#' @param x A character column or coercible as a character column. Will give the donut's fill color.
|
||||||
|
#' @param y A numeric column.
|
||||||
|
#' @param alpha Fill transparency.
|
||||||
|
#' @param x_title The x scale 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 arrange TRUE or FALSE. Arrange by highest percentage first.
|
||||||
|
#' @param hole_size Hole size. Default to 3. If less than 2, back to a pie chart.
|
||||||
|
#' @param add_text TRUE or FALSE. Add the value as text.
|
||||||
|
#' @param add_text_treshold_display Minimum value to add the text label.
|
||||||
|
#' @param add_text_color Text color.
|
||||||
|
#' @param add_text_suffix If percent is FALSE, should we add a suffix to the text label?
|
||||||
|
#' @param theme Whatever theme. Default to theme_reach().
|
||||||
|
#'
|
||||||
|
#' @return A donut chart to be used parsimoniously
|
||||||
|
#'
|
||||||
|
#' @export
|
||||||
|
donut <- function(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)){
|
||||||
|
|
||||||
|
# Arrange by biggest prop first ?
|
||||||
|
if (arrange) df <- dplyr::arrange(
|
||||||
|
df,
|
||||||
|
{{ y }}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Get levels for scaling
|
||||||
|
lev <- dplyr::pull(df, {{ x }})
|
||||||
|
df <- dplyr::mutate(df, "{{x}}" := factor({{ x }}, levels = lev))
|
||||||
|
|
||||||
|
# Mapping
|
||||||
|
g <- ggplot2::ggplot(
|
||||||
|
df,
|
||||||
|
mapping = ggplot2::aes(
|
||||||
|
x = hole_size,
|
||||||
|
y = {{ y }},
|
||||||
|
fill = {{ x }},
|
||||||
|
color = {{ x }}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add rect
|
||||||
|
g <- g + ggplot2::geom_col(alpha = alpha)
|
||||||
|
|
||||||
|
|
||||||
|
# Add text labels
|
||||||
|
if (add_text) {
|
||||||
|
|
||||||
|
df <- dplyr::mutate(df, y_treshold = ifelse({{ y }} >= add_text_treshold_display, {{ y }}, NA ))
|
||||||
|
|
||||||
|
g <- g +
|
||||||
|
ggplot2::geom_text(
|
||||||
|
data = df,
|
||||||
|
ggplot2::aes(
|
||||||
|
x = hole_size,
|
||||||
|
y = !!rlang::sym("y_treshold"),
|
||||||
|
label = paste0({{ y }}, add_text_suffix)),
|
||||||
|
color = add_text_color,
|
||||||
|
position = ggplot2::position_stack(vjust = 0.5))
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add title, subtitle, caption, x_title, y_title
|
||||||
|
g <- g + ggplot2::labs(
|
||||||
|
title = title,
|
||||||
|
subtitle = subtitle,
|
||||||
|
caption = caption,
|
||||||
|
fill = x_title,
|
||||||
|
color = x_title
|
||||||
|
)
|
||||||
|
|
||||||
|
# Transform to polar coordinates and adjust hole
|
||||||
|
g <- g +
|
||||||
|
ggplot2::coord_polar(
|
||||||
|
theta = "y"
|
||||||
|
)
|
||||||
|
if (hole_size >= 2) g <- g + ggplot2::xlim(c(1, hole_size + 0.5)) # Try to remove that to see how to make a pie chart
|
||||||
|
|
||||||
|
# No axis
|
||||||
|
g <- g + ggplot2::theme(
|
||||||
|
axis.line.x = ggplot2::element_blank(),
|
||||||
|
axis.ticks.x = ggplot2::element_blank(),
|
||||||
|
axis.text.x = ggplot2::element_blank(),
|
||||||
|
axis.title.x = ggplot2::element_blank(),
|
||||||
|
axis.line.y = ggplot2::element_blank(),
|
||||||
|
axis.ticks.y = ggplot2::element_blank(),
|
||||||
|
axis.text.y = ggplot2::element_blank(),
|
||||||
|
axis.title.y = ggplot2::element_blank()
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add theme
|
||||||
|
g <- g + theme
|
||||||
|
|
||||||
|
return(g)
|
||||||
|
|
||||||
|
}
|
||||||
121
R/lollipop.R
Normal file
|
|
@ -0,0 +1,121 @@
|
||||||
|
#' @title Simple bar chart
|
||||||
|
#'
|
||||||
|
#' @param df A data frame.
|
||||||
|
#' @param x A numeric column.
|
||||||
|
#' @param y A character column or coercible as a character column.
|
||||||
|
#' @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.
|
||||||
|
#' @param point_size Point size.
|
||||||
|
#' @param point_color Point color.
|
||||||
|
#' @param point_alpha Point alpha.
|
||||||
|
#' @param segment_size Segment size.
|
||||||
|
#' @param segment_color Segment color.
|
||||||
|
#' @param segment_alpha Segment alpha.
|
||||||
|
#' @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 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".
|
||||||
|
#' @param theme Whatever theme. Default to theme_reach().
|
||||||
|
#'
|
||||||
|
#' @return A bar chart
|
||||||
|
#'
|
||||||
|
#' @export
|
||||||
|
lollipop <- function(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()){
|
||||||
|
|
||||||
|
|
||||||
|
# Arrange by biggest prop first ?
|
||||||
|
if (arrange) df <- dplyr::arrange(
|
||||||
|
df,
|
||||||
|
{{ y }}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Get levels for scaling
|
||||||
|
lev <- dplyr::pull(df, {{ x }})
|
||||||
|
df <- dplyr::mutate(df, "{{x}}" := factor({{ x }}, levels = lev))
|
||||||
|
|
||||||
|
# Mapping
|
||||||
|
g <- ggplot2::ggplot(
|
||||||
|
df,
|
||||||
|
mapping = ggplot2::aes(x = {{ x }}, y = {{ y }}, xend = {{ x }}, yend = 0)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add segment
|
||||||
|
g <- g + ggplot2::geom_segment(
|
||||||
|
linewidth = segment_size,
|
||||||
|
alpha = segment_alpha,
|
||||||
|
color = segment_color
|
||||||
|
)
|
||||||
|
|
||||||
|
g <- g + ggplot2::geom_point(
|
||||||
|
size = point_size,
|
||||||
|
alpha = point_alpha,
|
||||||
|
color = point_color
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!is.null(wrap)) {
|
||||||
|
g <- g + ggplot2::scale_x_discrete(labels = scales::label_wrap(wrap))
|
||||||
|
}
|
||||||
|
|
||||||
|
# Because a text legend should always be horizontal, especially for an horizontal bar graph
|
||||||
|
if (flip){
|
||||||
|
g <- g + ggplot2::coord_flip()
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add text labels
|
||||||
|
if (add_text) {
|
||||||
|
g <- g + ggplot2::geom_text(
|
||||||
|
ggplot2::aes(
|
||||||
|
label = paste0({{ y }}, add_text_suffix)),
|
||||||
|
size = add_text_size,
|
||||||
|
color = add_text_color,
|
||||||
|
fontface = add_text_fontface)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add title, subtitle, caption, x_title, y_title
|
||||||
|
g <- g + ggplot2::labs(
|
||||||
|
title = title,
|
||||||
|
subtitle = subtitle,
|
||||||
|
caption = caption,
|
||||||
|
x = x_title,
|
||||||
|
y = y_title,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Add theme
|
||||||
|
g <- g + theme
|
||||||
|
|
||||||
|
return(g)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -29,14 +29,22 @@
|
||||||
#' @param axis_text_size Axis text size.
|
#' @param axis_text_size Axis text size.
|
||||||
#' @param axis_text_color Axis text color.
|
#' @param axis_text_color Axis text color.
|
||||||
#' @param axis_text_font_face Axis text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").
|
#' @param axis_text_font_face Axis text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").
|
||||||
|
#' @param axis_text_x_angle Angle for the x-axis text.
|
||||||
|
#' @param axis_text_x_vjust Vertical adjustment for the x-axis text.
|
||||||
|
#' @param axis_text_x_hjust Vertical adjustment for the x-axis text.
|
||||||
#' @param axis_title_size Axis title size.
|
#' @param axis_title_size Axis title size.
|
||||||
#' @param axis_title_color Axis title color.
|
#' @param axis_title_color Axis title color.
|
||||||
#' @param axis_title_font_face Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").
|
#' @param axis_title_font_face Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").
|
||||||
#' @param grid_x Boolean. Do you need major grid lines for x-axis?
|
#' @param grid_major_x Boolean. Do you need major grid lines for x-axis?
|
||||||
#' @param grid_y Boolean. Do you need major grid lines for y-axis?
|
#' @param grid_major_y Boolean. Do you need major grid lines for y-axis?
|
||||||
#' @param grid_x_size X line size.
|
#' @param grid_major_x_size Major X line size.
|
||||||
#' @param grid_y_size Y line size.
|
#' @param grid_major_y_size Major Y line size.
|
||||||
#' @param grid_color Grid lines color.
|
#' @param grid_major_color Major grid lines color.
|
||||||
|
#' @param grid_minor_x Boolean. Do you need minor grid lines for x-axis?
|
||||||
|
#' @param grid_minor_y Boolean. Do you need minor grid lines for y-axis?
|
||||||
|
#' @param grid_minor_x_size Minor X line size.
|
||||||
|
#' @param grid_minor_y_size Minor Y line size.
|
||||||
|
#' @param grid_minor_color Minor grid lines color.
|
||||||
#' @param caption_position_to_plot TRUE or FALSE. Positioning to plot or to panel?
|
#' @param caption_position_to_plot TRUE or FALSE. Positioning to plot or to panel?
|
||||||
#' @param ... Additional arguments passed to `ggplot2::gg_theme()`.
|
#' @param ... Additional arguments passed to `ggplot2::gg_theme()`.
|
||||||
#'
|
#'
|
||||||
|
|
@ -50,7 +58,7 @@ theme_reach <- function(
|
||||||
palette = "main",
|
palette = "main",
|
||||||
discrete = TRUE,
|
discrete = TRUE,
|
||||||
reverse = FALSE,
|
reverse = FALSE,
|
||||||
font_family = "Leelawadee",
|
font_family = "Segoe UI",
|
||||||
title_size = 12,
|
title_size = 12,
|
||||||
title_color = cols_reach("main_grey"),
|
title_color = cols_reach("main_grey"),
|
||||||
title_font_face = "bold",
|
title_font_face = "bold",
|
||||||
|
|
@ -76,11 +84,19 @@ theme_reach <- function(
|
||||||
axis_title_size = 11,
|
axis_title_size = 11,
|
||||||
axis_title_color = cols_reach("main_grey"),
|
axis_title_color = cols_reach("main_grey"),
|
||||||
axis_title_font_face = "bold",
|
axis_title_font_face = "bold",
|
||||||
grid_x = FALSE,
|
axis_text_x_angle = 0,
|
||||||
grid_y = FALSE,
|
axis_text_x_vjust = 0.5,
|
||||||
grid_color = cols_reach("main_lt_grey"),
|
axis_text_x_hjust = 0.5,
|
||||||
grid_x_size = 0.1,
|
grid_major_x = FALSE,
|
||||||
grid_y_size = 0.1,
|
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,
|
caption_position_to_plot = TRUE,
|
||||||
...
|
...
|
||||||
) {
|
) {
|
||||||
|
|
@ -114,9 +130,6 @@ theme_reach <- function(
|
||||||
panel.background = ggplot2::element_rect(
|
panel.background = ggplot2::element_rect(
|
||||||
fill = panel_background_color
|
fill = panel_background_color
|
||||||
),
|
),
|
||||||
# Remove minor grid lines
|
|
||||||
panel.grid.minor.x = ggplot2::element_blank(),
|
|
||||||
panel.grid.minor.y = ggplot2::element_blank(),
|
|
||||||
# Remove background for legend key
|
# Remove background for legend key
|
||||||
legend.key = ggplot2::element_blank(),
|
legend.key = ggplot2::element_blank(),
|
||||||
# Text sizes
|
# Text sizes
|
||||||
|
|
@ -145,6 +158,11 @@ theme_reach <- function(
|
||||||
face = legend_text_font_face,
|
face = legend_text_font_face,
|
||||||
family = font_family,
|
family = font_family,
|
||||||
color = legend_text_color
|
color = legend_text_color
|
||||||
|
),
|
||||||
|
axis.text.x = ggplot2::element_text(
|
||||||
|
angle = axis_text_x_angle,
|
||||||
|
vjust = axis_text_x_vjust,
|
||||||
|
hjust = axis_text_x_hjust
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -184,25 +202,47 @@ theme_reach <- function(
|
||||||
}
|
}
|
||||||
|
|
||||||
# X - major grid lines
|
# X - major grid lines
|
||||||
if (!grid_x) theme_reach <- theme_reach +
|
if (!grid_major_x) theme_reach <- theme_reach +
|
||||||
ggplot2::theme(
|
ggplot2::theme(
|
||||||
panel.grid.major.x = ggplot2::element_blank()
|
panel.grid.major.x = ggplot2::element_blank()
|
||||||
) else theme_reach <- theme_reach +
|
) else theme_reach <- theme_reach +
|
||||||
ggplot2::theme(
|
ggplot2::theme(
|
||||||
panel.grid.major.x = ggplot2::element_line(
|
panel.grid.major.x = ggplot2::element_line(
|
||||||
color = grid_color,
|
color = grid_major_color,
|
||||||
linewidth = grid_y_size)
|
linewidth = grid_major_x_size)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Y - major grid lines
|
# Y - major grid lines
|
||||||
if (!grid_y) theme_reach <- theme_reach +
|
if (!grid_major_y) theme_reach <- theme_reach +
|
||||||
ggplot2::theme(
|
ggplot2::theme(
|
||||||
panel.grid.major.y = ggplot2::element_blank()
|
panel.grid.major.y = ggplot2::element_blank()
|
||||||
) else theme_reach <- theme_reach +
|
) else theme_reach <- theme_reach +
|
||||||
ggplot2::theme(
|
ggplot2::theme(
|
||||||
panel.grid.major.y = ggplot2::element_line(
|
panel.grid.major.y = ggplot2::element_line(
|
||||||
color = grid_color,
|
color = grid_major_color,
|
||||||
linewidth = grid_y_size)
|
linewidth = grid_major_y_size)
|
||||||
|
)
|
||||||
|
|
||||||
|
# X - minor grid lines
|
||||||
|
if (!grid_minor_x) theme_reach <- theme_reach +
|
||||||
|
ggplot2::theme(
|
||||||
|
panel.grid.minor.x = ggplot2::element_blank()
|
||||||
|
) else theme_reach <- theme_reach +
|
||||||
|
ggplot2::theme(
|
||||||
|
panel.grid.minor.x = ggplot2::element_line(
|
||||||
|
color = grid_minor_color,
|
||||||
|
linewidth = grid_minor_x_size)
|
||||||
|
)
|
||||||
|
|
||||||
|
# Y - minor grid lines
|
||||||
|
if (!grid_minor_y) theme_reach <- theme_reach +
|
||||||
|
ggplot2::theme(
|
||||||
|
panel.grid.minor.y = ggplot2::element_blank()
|
||||||
|
) else theme_reach <- theme_reach +
|
||||||
|
ggplot2::theme(
|
||||||
|
panel.grid.minor.y = ggplot2::element_line(
|
||||||
|
color = grid_minor_color,
|
||||||
|
linewidth = grid_minor_y_size)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Other parameters
|
# Other parameters
|
||||||
|
|
|
||||||
127
README.Rmd
|
|
@ -43,10 +43,11 @@ Roadmap is as follows:
|
||||||
- [X] Add IMPACT's colors
|
- [X] Add IMPACT's colors
|
||||||
- [X] Add all color palettes from the internal documentation
|
- [X] Add all color palettes from the internal documentation
|
||||||
- [ ] There remains to be added more-than-7-color palettes and black color palettes
|
- [ ] There remains to be added more-than-7-color palettes and black color palettes
|
||||||
- [ ] Add new types of visualization (e.g. dumbbell plot)
|
- [X] Add new types of visualization (e.g. dumbbell plot, lollipop plot, etc.)
|
||||||
- [ ] Use examples
|
- [X] Use examples
|
||||||
- [ ] Add some ease-map functions
|
- [ ] Add some ease-map functions
|
||||||
- [ ] Add some interactive functions (maps and graphs)
|
- [ ] Add some interactive functions (maps and graphs)
|
||||||
|
- [ ] Consolidate and make errors transparent
|
||||||
|
|
||||||
## Request
|
## Request
|
||||||
|
|
||||||
|
|
@ -73,7 +74,7 @@ pal_reach(show_palettes = T)
|
||||||
|
|
||||||
### Example 1: Bar chart, already REACH themed
|
### Example 1: Bar chart, already REACH themed
|
||||||
|
|
||||||
```{r example-bar-chart, eval = TRUE}
|
```{r example-bar-chart, out.width = "65%", eval = TRUE}
|
||||||
library(visualizeR)
|
library(visualizeR)
|
||||||
library(palmerpenguins)
|
library(palmerpenguins)
|
||||||
library(dplyr)
|
library(dplyr)
|
||||||
|
|
@ -100,7 +101,7 @@ bar(df, island, mean_bl, species, group_title = "Species", flip = FALSE, add_tex
|
||||||
|
|
||||||
At this stage, `point_reach()` only supports categorical grouping colors with the `group` arg.
|
At this stage, `point_reach()` only supports categorical grouping colors with the `group` arg.
|
||||||
|
|
||||||
```{r example-point-chart, eval = TRUE}
|
```{r example-point-chart, out.width = "65%", eval = TRUE}
|
||||||
|
|
||||||
# Simple point chart
|
# Simple point chart
|
||||||
point(penguins, bill_length_mm, flipper_length_mm)
|
point(penguins, bill_length_mm, flipper_length_mm)
|
||||||
|
|
@ -109,39 +110,143 @@ point(penguins, bill_length_mm, flipper_length_mm)
|
||||||
point(penguins, bill_length_mm, flipper_length_mm, island, alpha = 0.6, size = 3, theme = theme_reach(reverse = TRUE))
|
point(penguins, bill_length_mm, flipper_length_mm, island, alpha = 0.6, size = 3, theme = theme_reach(reverse = TRUE))
|
||||||
|
|
||||||
# Using another color palettes
|
# 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))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 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 values.
|
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.
|
||||||
|
|
||||||
```{r example-dumbbell-plot, eval = TRUE}
|
```{r example-dumbbell-plot, out.width = "65%", eval = TRUE}
|
||||||
# Prepare long data
|
# Prepare long data
|
||||||
df <- tibble::tibble(
|
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)),
|
setting = c(rep(c("Rural", "Urban"), 4), rep(c("Urban", "Rural"), 4)),
|
||||||
stat = rnorm(16, mean = 50, sd = 18)
|
stat = rnorm(16, mean = 50, sd = 18)
|
||||||
) |>
|
) |>
|
||||||
dplyr::mutate(stat = round(stat, 0))
|
dplyr::mutate(stat = round(stat, 0))
|
||||||
|
|
||||||
# Example
|
# Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title
|
||||||
dumbbell(df,
|
dumbbell(df,
|
||||||
stat,
|
stat,
|
||||||
setting,
|
setting,
|
||||||
admin1,
|
admin1,
|
||||||
title = "% of HHs that reported open defecation as sanitation facility",
|
title = "% of HHs that reported open defecation as sanitation facility",
|
||||||
group_y_title = "Admin 1",
|
group_y_title = "Admin 1",
|
||||||
|
group_x_title = "Setting",
|
||||||
theme = theme_reach(legend_position = "bottom",
|
theme = theme_reach(legend_position = "bottom",
|
||||||
legend_direction = "horizontal",
|
legend_direction = "horizontal",
|
||||||
|
legend_title_font_face = "bold",
|
||||||
palette = "primary",
|
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")
|
||||||
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Example 4: donut chart, REACH themed (to used moderately)
|
||||||
|
```{r example-donut-plot, out.width = "65%", warning = FALSE}
|
||||||
|
|
||||||
|
# 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))
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example 5: alluvial chart, REACH themed
|
||||||
|
```{r example-alluvial-plot, out.width = "65%", warning = FALSE}
|
||||||
|
|
||||||
|
# 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"))
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Example 6: lollipop chart
|
||||||
|
```{r example-lollipop-chart, out.width = "65%", warning = FALSE}
|
||||||
|
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))
|
||||||
|
|
||||||
|
# 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))
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Maps
|
## Maps
|
||||||
|
|
||||||
```{r example-map}
|
```{r example-map, out.width = "50%"}
|
||||||
|
|
||||||
# Add indicator layer
|
# Add indicator layer
|
||||||
# - based on "pretty" classes and title "Proportion (%)"
|
# - based on "pretty" classes and title "Proportion (%)"
|
||||||
|
|
|
||||||
141
README.md
|
|
@ -27,10 +27,12 @@ Roadmap is as follows:
|
||||||
- [x] Add all color palettes from the internal documentation
|
- [x] Add all color palettes from the internal documentation
|
||||||
- [ ] There remains to be added more-than-7-color palettes and black
|
- [ ] There remains to be added more-than-7-color palettes and black
|
||||||
color palettes
|
color palettes
|
||||||
- [ ] Add new types of visualization (e.g. dumbbell plot)
|
- [x] Add new types of visualization (e.g. dumbbell plot, lollipop
|
||||||
- [ ] Use examples
|
plot, etc.)
|
||||||
|
- [x] Use examples
|
||||||
- [ ] Add some ease-map functions
|
- [ ] Add some ease-map functions
|
||||||
- [ ] Add some interactive functions (maps and graphs)
|
- [ ] Add some interactive functions (maps and graphs)
|
||||||
|
- [ ] Consolidate and make errors transparent
|
||||||
|
|
||||||
## Request
|
## Request
|
||||||
|
|
||||||
|
|
@ -93,21 +95,21 @@ df <- penguins |>
|
||||||
bar(df, island, mean_bl, species, percent = FALSE, alpha = 0.6, x_title = "Mean of bill length")
|
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
|
``` r
|
||||||
# Using another color palette through `theme_reach()` and changing scale to percent
|
# 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"))
|
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
|
``` r
|
||||||
# Not flipped, with text added, group_title, no y-axis and no bold for legend
|
# 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))
|
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
|
### Example 2: Point chart, already REACH themed
|
||||||
|
|
||||||
|
|
@ -119,23 +121,23 @@ with the `group` arg.
|
||||||
point(penguins, bill_length_mm, flipper_length_mm)
|
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
|
``` r
|
||||||
# Point chart with grouping colors, greater dot size, some transparency, reversed color palette
|
# 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))
|
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
|
``` r
|
||||||
# Using another color palettes
|
# 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
|
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
|
have two groups on the x-axis; for instance, IDP and returnee and no NA
|
||||||
|
|
@ -144,26 +146,137 @@ values.
|
||||||
``` r
|
``` r
|
||||||
# Prepare long data
|
# Prepare long data
|
||||||
df <- tibble::tibble(
|
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)),
|
setting = c(rep(c("Rural", "Urban"), 4), rep(c("Urban", "Rural"), 4)),
|
||||||
stat = rnorm(16, mean = 50, sd = 18)
|
stat = rnorm(16, mean = 50, sd = 18)
|
||||||
) |>
|
) |>
|
||||||
dplyr::mutate(stat = round(stat, 0))
|
dplyr::mutate(stat = round(stat, 0))
|
||||||
|
|
||||||
# Example
|
# Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title
|
||||||
dumbbell(df,
|
dumbbell(df,
|
||||||
stat,
|
stat,
|
||||||
setting,
|
setting,
|
||||||
admin1,
|
admin1,
|
||||||
title = "% of HHs that reported open defecation as sanitation facility",
|
title = "% of HHs that reported open defecation as sanitation facility",
|
||||||
group_y_title = "Admin 1",
|
group_y_title = "Admin 1",
|
||||||
|
group_x_title = "Setting",
|
||||||
theme = theme_reach(legend_position = "bottom",
|
theme = theme_reach(legend_position = "bottom",
|
||||||
legend_direction = "horizontal",
|
legend_direction = "horizontal",
|
||||||
|
legend_title_font_face = "bold",
|
||||||
palette = "primary",
|
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
|
## Maps
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="https://gnoblet.github.io/visualizeR/index.html">visualizeR</a>
|
<a class="navbar-brand me-2" href="https://gnoblet.github.io/visualizeR/index.html">visualizeR</a>
|
||||||
|
|
||||||
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.6.9000</small>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<h2 id="citation">Citation</h2>
|
<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><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>.
|
<em>visualizeR: What a color! What a viz!</em>.
|
||||||
https://github.com/gnoblet/visualizeR,
|
https://github.com/gnoblet/visualizeR,
|
||||||
https://gnoblet.github.io/visualizeR/.
|
https://gnoblet.github.io/visualizeR/.
|
||||||
|
|
@ -64,7 +64,7 @@ https://gnoblet.github.io/visualizeR/.
|
||||||
<pre>@Manual{,
|
<pre>@Manual{,
|
||||||
title = {visualizeR: What a color! What a viz!},
|
title = {visualizeR: What a color! What a viz!},
|
||||||
author = {Noblet Guillaume},
|
author = {Noblet Guillaume},
|
||||||
year = {2022},
|
year = {2023},
|
||||||
note = {https://github.com/gnoblet/visualizeR,
|
note = {https://github.com/gnoblet/visualizeR,
|
||||||
https://gnoblet.github.io/visualizeR/},
|
https://gnoblet.github.io/visualizeR/},
|
||||||
}</pre>
|
}</pre>
|
||||||
|
|
|
||||||
139
docs/index.html
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
@ -94,13 +94,15 @@
|
||||||
<li>
|
<li>
|
||||||
<input type="checkbox" disabled>There remains to be added more-than-7-color palettes and black color palettes</li>
|
<input type="checkbox" disabled>There remains to be added more-than-7-color palettes and black color palettes</li>
|
||||||
<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>
|
<li>
|
||||||
<input type="checkbox" disabled>Use examples</li>
|
<input type="checkbox" disabled checked>Use examples</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="checkbox" disabled>Add some ease-map functions</li>
|
<input type="checkbox" disabled>Add some ease-map functions</li>
|
||||||
<li>
|
<li>
|
||||||
<input type="checkbox" disabled>Add some interactive functions (maps and graphs)</li>
|
<input type="checkbox" disabled>Add some interactive functions (maps and graphs)</li>
|
||||||
|
<li>
|
||||||
|
<input type="checkbox" disabled>Consolidate and make errors transparent</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section level2">
|
<div class="section level2">
|
||||||
|
|
@ -158,15 +160,15 @@
|
||||||
<span></span>
|
<span></span>
|
||||||
<span><span class="co"># Simple bar chart by group with some alpha transparency</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>
|
<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">
|
<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>
|
<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>
|
<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">
|
<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>
|
<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>
|
<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>
|
||||||
<div class="section level3">
|
<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>
|
<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">
|
<div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
|
||||||
<code class="sourceCode R"><span><span class="co"># Simple point chart</span></span>
|
<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>
|
<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">
|
<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>
|
<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>
|
<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">
|
<div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
|
||||||
<code class="sourceCode R"><span><span class="co"># Using another color palettes</span></span>
|
<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>
|
<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="100%"></p>
|
<p><img src="reference/figures/README-example-point-chart-3.png" width="65%"></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section level3">
|
<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>
|
</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>
|
<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">
|
<div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
|
||||||
<code class="sourceCode R"><span><span class="co"># Prepare long data</span></span>
|
<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><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> 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> 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="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 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>
|
||||||
<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="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">stat</span>,</span>
|
||||||
<span> <span class="va">setting</span>,</span>
|
<span> <span class="va">setting</span>,</span>
|
||||||
<span> <span class="va">admin1</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> 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_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> 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_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> 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>
|
<span> title_position_to_plot <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||||
<p><img src="reference/figures/README-example-dumbbell-plot-1.png" width="100%"></p>
|
<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>
|
</div>
|
||||||
<div class="section level2">
|
<div class="section level2">
|
||||||
<h2 id="maps">Maps<a class="anchor" aria-label="anchor" href="#maps"></a>
|
<h2 id="maps">Maps<a class="anchor" aria-label="anchor" href="#maps"></a>
|
||||||
</h2>
|
</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>
|
<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"># - based on "pretty" classes and title "Proportion (%)" </span></span>
|
||||||
<span><span class="co"># - buffer to add a 10% around the bounding box</span></span>
|
<span><span class="co"># - buffer to add a 10% around the bounding box</span></span>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
@ -47,8 +47,18 @@
|
||||||
<div class="section level2">
|
<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>
|
<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>
|
<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>
|
||||||
|
<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.6.9000" id="visualizer-069000-1">visualizeR 0.6.9000<a class="anchor" aria-label="anchor" href="#visualizer-069000-1"></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>
|
||||||
</ul><hr></div>
|
</ul><hr></div>
|
||||||
<div class="section level2">
|
<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>
|
<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: 2.0.7
|
||||||
pkgdown_sha: ~
|
pkgdown_sha: ~
|
||||||
articles: {}
|
articles: {}
|
||||||
last_built: 2022-12-24T23:19Z
|
last_built: 2023-01-25T00:47Z
|
||||||
urls:
|
urls:
|
||||||
reference: https://gnoblet.github.io/visualizeR/reference
|
reference: https://gnoblet.github.io/visualizeR/reference
|
||||||
article: https://gnoblet.github.io/visualizeR/articles
|
article: https://gnoblet.github.io/visualizeR/articles
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
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.7.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>
|
||||||
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
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.7.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>
|
||||||
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
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 |
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
@ -96,6 +96,11 @@
|
||||||
<dd>Add a scale bar</dd>
|
<dd>Add a scale bar</dd>
|
||||||
</dl><dl><dt>
|
</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>
|
<code><a href="bar.html">bar()</a></code>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>Simple bar chart</dd>
|
<dd>Simple bar chart</dd>
|
||||||
|
|
@ -131,6 +136,11 @@
|
||||||
<dd>Function to extract REACH colors as hex codes</dd>
|
<dd>Function to extract REACH colors as hex codes</dd>
|
||||||
</dl><dl><dt>
|
</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>
|
<code><a href="dumbbell.html">dumbbell()</a></code>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>Make dumbbell chart.</dd>
|
<dd>Make dumbbell chart.</dd>
|
||||||
|
|
@ -161,6 +171,11 @@
|
||||||
<dd>Haïti admin 1 lines shapefile.</dd>
|
<dd>Haïti admin 1 lines shapefile.</dd>
|
||||||
</dl><dl><dt>
|
</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>
|
<code><a href="pal_agora.html">pal_agora()</a></code>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>Return function to interpolate an AGORA color palette</dd>
|
<dd>Return function to interpolate an AGORA color palette</dd>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
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.7.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>
|
||||||
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<a class="navbar-brand me-2" href="../index.html">visualizeR</a>
|
<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>
|
<small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.7.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">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
<span> palette <span class="op">=</span> <span class="st">"main"</span>,</span>
|
<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> discrete <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||||
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
<span> reverse <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||||
<span> 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_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_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>
|
<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_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_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> 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> axis_text_x_angle <span class="op">=</span> <span class="fl">0</span>,</span>
|
||||||
<span> grid_y <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
<span> axis_text_x_vjust <span class="op">=</span> <span class="fl">0.5</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> axis_text_x_hjust <span class="op">=</span> <span class="fl">0.5</span>,</span>
|
||||||
<span> grid_x_size <span class="op">=</span> <span class="fl">0.1</span>,</span>
|
<span> grid_major_x <span class="op">=</span> <span class="cn">FALSE</span>,</span>
|
||||||
<span> grid_y_size <span class="op">=</span> <span class="fl">0.1</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> caption_position_to_plot <span class="op">=</span> <span class="cn">TRUE</span>,</span>
|
||||||
<span> <span class="va">...</span></span>
|
<span> <span class="va">...</span></span>
|
||||||
<span><span class="op">)</span></span></code></pre></div>
|
<span><span class="op">)</span></span></code></pre></div>
|
||||||
|
|
@ -209,24 +217,56 @@
|
||||||
<dd><p>Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").</p></dd>
|
<dd><p>Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").</p></dd>
|
||||||
|
|
||||||
|
|
||||||
<dt>grid_x</dt>
|
<dt>axis_text_x_angle</dt>
|
||||||
|
<dd><p>Angle for the x-axis text.</p></dd>
|
||||||
|
|
||||||
|
|
||||||
|
<dt>axis_text_x_vjust</dt>
|
||||||
|
<dd><p>Vertical adjustment for the x-axis text.</p></dd>
|
||||||
|
|
||||||
|
|
||||||
|
<dt>axis_text_x_hjust</dt>
|
||||||
|
<dd><p>Vertical adjustment for the x-axis text.</p></dd>
|
||||||
|
|
||||||
|
|
||||||
|
<dt>grid_major_x</dt>
|
||||||
<dd><p>Boolean. Do you need major grid lines for x-axis?</p></dd>
|
<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>
|
<dd><p>Boolean. Do you need major grid lines for y-axis?</p></dd>
|
||||||
|
|
||||||
|
|
||||||
<dt>grid_color</dt>
|
<dt>grid_major_color</dt>
|
||||||
<dd><p>Grid lines color.</p></dd>
|
<dd><p>Major grid lines color.</p></dd>
|
||||||
|
|
||||||
|
|
||||||
<dt>grid_x_size</dt>
|
<dt>grid_major_x_size</dt>
|
||||||
<dd><p>X line size.</p></dd>
|
<dd><p>Major X line size.</p></dd>
|
||||||
|
|
||||||
|
|
||||||
<dt>grid_y_size</dt>
|
<dt>grid_major_y_size</dt>
|
||||||
<dd><p>Y line size.</p></dd>
|
<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>
|
<dt>caption_position_to_plot</dt>
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@
|
||||||
<url>
|
<url>
|
||||||
<loc>https://gnoblet.github.io/visualizeR/reference/add_scale_bar.html</loc>
|
<loc>https://gnoblet.github.io/visualizeR/reference/add_scale_bar.html</loc>
|
||||||
</url>
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://gnoblet.github.io/visualizeR/reference/alluvial.html</loc>
|
||||||
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://gnoblet.github.io/visualizeR/reference/bar.html</loc>
|
<loc>https://gnoblet.github.io/visualizeR/reference/bar.html</loc>
|
||||||
</url>
|
</url>
|
||||||
|
|
@ -60,6 +63,9 @@
|
||||||
<url>
|
<url>
|
||||||
<loc>https://gnoblet.github.io/visualizeR/reference/cols_reach.html</loc>
|
<loc>https://gnoblet.github.io/visualizeR/reference/cols_reach.html</loc>
|
||||||
</url>
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://gnoblet.github.io/visualizeR/reference/donut.html</loc>
|
||||||
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://gnoblet.github.io/visualizeR/reference/dumbbell.html</loc>
|
<loc>https://gnoblet.github.io/visualizeR/reference/dumbbell.html</loc>
|
||||||
</url>
|
</url>
|
||||||
|
|
@ -81,6 +87,9 @@
|
||||||
<url>
|
<url>
|
||||||
<loc>https://gnoblet.github.io/visualizeR/reference/line_admin1.html</loc>
|
<loc>https://gnoblet.github.io/visualizeR/reference/line_admin1.html</loc>
|
||||||
</url>
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://gnoblet.github.io/visualizeR/reference/lollipop.html</loc>
|
||||||
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://gnoblet.github.io/visualizeR/reference/pal_agora.html</loc>
|
<loc>https://gnoblet.github.io/visualizeR/reference/pal_agora.html</loc>
|
||||||
</url>
|
</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",
|
palette = "main",
|
||||||
discrete = TRUE,
|
discrete = TRUE,
|
||||||
reverse = FALSE,
|
reverse = FALSE,
|
||||||
font_family = "Leelawadee",
|
font_family = "Segoe UI",
|
||||||
title_size = 12,
|
title_size = 12,
|
||||||
title_color = cols_reach("main_grey"),
|
title_color = cols_reach("main_grey"),
|
||||||
title_font_face = "bold",
|
title_font_face = "bold",
|
||||||
|
|
@ -34,11 +34,19 @@ theme_reach(
|
||||||
axis_title_size = 11,
|
axis_title_size = 11,
|
||||||
axis_title_color = cols_reach("main_grey"),
|
axis_title_color = cols_reach("main_grey"),
|
||||||
axis_title_font_face = "bold",
|
axis_title_font_face = "bold",
|
||||||
grid_x = FALSE,
|
axis_text_x_angle = 0,
|
||||||
grid_y = FALSE,
|
axis_text_x_vjust = 0.5,
|
||||||
grid_color = cols_reach("main_lt_grey"),
|
axis_text_x_hjust = 0.5,
|
||||||
grid_x_size = 0.1,
|
grid_major_x = FALSE,
|
||||||
grid_y_size = 0.1,
|
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,
|
caption_position_to_plot = TRUE,
|
||||||
...
|
...
|
||||||
)
|
)
|
||||||
|
|
@ -102,15 +110,31 @@ theme_reach(
|
||||||
|
|
||||||
\item{axis_title_font_face}{Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").}
|
\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{axis_text_x_angle}{Angle for the x-axis text.}
|
||||||
|
|
||||||
\item{grid_y}{Boolean. Do you need major grid lines for y-axis?}
|
\item{axis_text_x_vjust}{Vertical adjustment for the x-axis text.}
|
||||||
|
|
||||||
\item{grid_color}{Grid lines color.}
|
\item{axis_text_x_hjust}{Vertical adjustment for the x-axis text.}
|
||||||
|
|
||||||
\item{grid_x_size}{X line size.}
|
\item{grid_major_x}{Boolean. Do you need major grid lines for x-axis?}
|
||||||
|
|
||||||
\item{grid_y_size}{Y line size.}
|
\item{grid_major_y}{Boolean. Do you need major grid lines for y-axis?}
|
||||||
|
|
||||||
|
\item{grid_major_color}{Major grid lines color.}
|
||||||
|
|
||||||
|
\item{grid_major_x_size}{Major X 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?}
|
\item{caption_position_to_plot}{TRUE or FALSE. Positioning to plot or to panel?}
|
||||||
|
|
||||||
|
|
|
||||||