diff --git a/index.html b/index.html
index 8f14006..0fa4762 100644
--- a/index.html
+++ b/index.html
@@ -63,17 +63,19 @@

-What a color! What a viz!
visualizeR proposes some utils to sane colors, ready-to-go color palettes, and a few visualization functions.
visualizeR proposes some utils to sane colors, ready-to-go color palettes, and a few visualization functions. The package is thoroughly tested with comprehensive code coverage.
You can install the last version of visualizeR from GitHub with:
# install.packages("devtools")
-devtools::install_github('gnoblet/visualizeR', build_vignettes = TRUE)Roadmap is as follows:
Please, do not hesitate to pull request any new viz or colors or color palettes, or to email request any change (gnoblet@zaclys.net).
visualizeR uses codecov for test coverage reporting. You can see the current coverage status by clicking on the codecov badge at the top of this README. We aim to maintain high test coverage to ensure code reliability and stability.
Functions to access colors and palettes are color() or palette(). Feel free to pull request new colors.


+plot of chunk example-bar-chart +
+
# Flipped / Horizontal
-hbar(df, 'island', 'mean_bl', 'species', x_title = 'Mean of bill length', title = 'Mean of bill length by island and species')

+plot of chunk example-bar-chart +
+
# Facetted
-bar(df, 'island', 'mean_bl', facet = 'species', x_title = 'Mean of bill length', title = 'Mean of bill length by island and species', add_color_guide = FALSE)

+plot of chunk example-bar-chart +
+
# Flipped, with text, smaller width, and caption
-hbar(df = df_island, x = 'island', y = 'mean_bl', title = 'Mean of bill length by island', add_text = T, width = 0.6, add_text_suffix = 'mm', add_text_expand_limit = 1.3, add_color_guide = FALSE, caption = "Data: palmerpenguins package.")

+plot of chunk example-bar-chart +
+
# Simple scatterplot
-point(penguins, 'bill_length_mm', 'flipper_length_mm')

+plot of chunk example-point-chart +
+
# Scatterplot with grouping colors, greater dot size, some transparency
-point(penguins, 'bill_length_mm', 'flipper_length_mm', 'island', group_title = 'Island', alpha = 0.6, size = 3, title = 'Bill vs. flipper length', , add_color_guide = FALSE)

+plot of chunk example-point-chart +
+
# Facetted scatterplot by island
-point(penguins, 'bill_length_mm', 'flipper_length_mm', 'species', 'island', 'fixed', group_title = 'Species', title = 'Bill vs. flipper length by species and island', add_color_guide = FALSE)

+plot of chunk example-point-chart +
+# Prepare long data
df <- tibble::tibble(
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)
) |>
dplyr::mutate(stat = round(stat, 0))
@@ -221,7 +258,7 @@
# Some summarized data: % of HHs by displacement status
df <- tibble::tibble(
- status = c('Displaced', 'Non displaced', 'Returnee', 'Don\'t know/Prefer not to say'),
+ status = c("Displaced", "Non displaced", "Returnee", "Don't know/Prefer not to say"),
percentage = c(18, 65, 12, 3)
)
@@ -251,12 +288,12 @@
# 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)
+ 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'),
+ 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)
)
@@ -296,7 +333,11 @@
x_title = "Admin 1",
title = "% of HHs that received humanitarian assistance"
)
-
+
+
+plot of chunk example-lollipop-chart
+
+
# Horizontal lollipop chart with custom colors
@@ -312,7 +353,11 @@
x_title = "Admin 1",
title = "% of HHs that received humanitarian assistance"
)
-
+
+
+plot of chunk example-lollipop-chart
+
+
# Create data for grouped lollipop - using set.seed for reproducibility
@@ -330,14 +375,19 @@
x = "admin1",
y = "stat",
group = "group",
- dodge_width = 0.8, # Control spacing between grouped lollipops
+ order = "grouped_y",
+ dodge_width = 0.8, # Control spacing between grouped lollipops
dot_size = 3.5,
line_size = 0.8,
y_title = "Value",
x_title = "Category",
title = "True side-by-side grouped lollipop chart"
)
-
+
+
+plot of chunk example-lollipop-chart
+
+
# Horizontal grouped lollipop chart
@@ -346,14 +396,18 @@
x = "admin1",
y = "stat",
group = "group",
- dodge_width = 0.7, # Narrower spacing for horizontal orientation
+ dodge_width = 0.7, # Narrower spacing for horizontal orientation
dot_size = 3.5,
line_size = 0.8,
y_title = "Category",
x_title = "Value",
title = "Horizontal side-by-side grouped lollipop chart"
)
-
+
+
+plot of chunk example-lollipop-chart
+
+