start revamp work
This commit is contained in:
parent
515a94fbb5
commit
a9b8b5f708
76 changed files with 4640 additions and 3472 deletions
|
|
@ -1,21 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/internals.R
|
||||
\name{abort_bad_argument}
|
||||
\alias{abort_bad_argument}
|
||||
\title{Abord bad argument}
|
||||
\usage{
|
||||
abort_bad_argument(arg, must, not = NULL)
|
||||
}
|
||||
\arguments{
|
||||
\item{arg}{An argument}
|
||||
|
||||
\item{must}{What arg must be}
|
||||
|
||||
\item{not}{Optional. What arg must not be.}
|
||||
}
|
||||
\value{
|
||||
A stop statement
|
||||
}
|
||||
\description{
|
||||
Abord bad argument
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/map.R
|
||||
\name{add_admin_boundaries}
|
||||
\alias{add_admin_boundaries}
|
||||
\title{Add admin boundaries (lines) and the legend}
|
||||
\usage{
|
||||
add_admin_boundaries(
|
||||
lines,
|
||||
colors,
|
||||
labels,
|
||||
lwds,
|
||||
title = "",
|
||||
buffer = NULL,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{lines}{List of multiline shape defined by sf package.}
|
||||
|
||||
\item{colors}{Vector of hexadecimal codes. Same order as lines.}
|
||||
|
||||
\item{labels}{Vector of labels in the legend. Same order as lines.}
|
||||
|
||||
\item{lwds}{Vector of line widths. Same order as lines.}
|
||||
|
||||
\item{title}{Legend title.}
|
||||
|
||||
\item{buffer}{A buffer, either one value or a vector of 4 values (left, bottom, right, top).}
|
||||
|
||||
\item{...}{Other arguments to pass to each shape in `tmap::tm_lines()`.}
|
||||
}
|
||||
\value{
|
||||
A tmap layer.
|
||||
}
|
||||
\description{
|
||||
Add admin boundaries (lines) and the legend
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/map.R
|
||||
\name{add_admin_labels}
|
||||
\alias{add_admin_labels}
|
||||
\title{Wrapper around `tmap::tm_text()` with sane defaults for plotting admin labels.}
|
||||
\usage{
|
||||
add_admin_labels(
|
||||
point,
|
||||
text,
|
||||
size = 0.5,
|
||||
fontface = "bold",
|
||||
fontfamily = "Leelawadee",
|
||||
shadow = TRUE,
|
||||
auto_placement = FALSE,
|
||||
remove_overlap = FALSE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{point}{Multipoint shape defined by sf package.}
|
||||
|
||||
\item{text}{Text labels column.}
|
||||
|
||||
\item{size}{Relative size of the text labels.}
|
||||
|
||||
\item{fontface}{Fontface.}
|
||||
|
||||
\item{fontfamily}{Fontfamily. Leelawadee is your precious.}
|
||||
|
||||
\item{shadow}{Boolean. Add a shadow around text labels. Issue opened on Github to request.}
|
||||
|
||||
\item{auto_placement}{Logical that determines whether the labels are placed automatically.}
|
||||
|
||||
\item{remove_overlap}{Logical that determines whether the overlapping labels are removed.}
|
||||
|
||||
\item{...}{Other arguments to pass to `tmap::tm_text()`.}
|
||||
}
|
||||
\value{
|
||||
A tmap layer.
|
||||
}
|
||||
\description{
|
||||
Wrapper around `tmap::tm_text()` with sane defaults for plotting admin labels.
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/map.R
|
||||
\name{add_compass}
|
||||
\alias{add_compass}
|
||||
\title{Add a compass}
|
||||
\usage{
|
||||
add_compass(
|
||||
text_size = 0.6,
|
||||
position = c("right", 0.8),
|
||||
color_dark = cols_reach("black"),
|
||||
text_color = cols_reach("black"),
|
||||
type = "4star",
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{text_size}{Relative font size.}
|
||||
|
||||
\item{position}{Position of the compass. Vector of two values, specifying the x and y coordinates.}
|
||||
|
||||
\item{color_dark}{Color of the dark parts of the compass.}
|
||||
|
||||
\item{text_color}{color of the text.}
|
||||
|
||||
\item{type}{Compass type, one of: "arrow", "4star", "8star", "radar", "rose".}
|
||||
|
||||
\item{...}{Other arguments to pass to `tmap::tm_compass()`.}
|
||||
}
|
||||
\value{
|
||||
A tmap layer.
|
||||
}
|
||||
\description{
|
||||
Add a compass
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/map.R
|
||||
\name{add_credits}
|
||||
\alias{add_credits}
|
||||
\title{Do you want to credit someone or some institution?}
|
||||
\usage{
|
||||
add_credits(text, size = 0.4, bg_color = NA, position = c(0.75, 0.02), ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{text}{Text.}
|
||||
|
||||
\item{size}{Relative text size.}
|
||||
|
||||
\item{bg_color}{Background color.}
|
||||
|
||||
\item{position}{Position. Vector of two coordinates. Usually somewhere down.}
|
||||
|
||||
\item{...}{Other arguments to pass to `tmap::tm_credits()`.}
|
||||
}
|
||||
\value{
|
||||
A tmap layer.
|
||||
}
|
||||
\description{
|
||||
Do you want to credit someone or some institution?
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/map.R
|
||||
\name{add_indicator_layer}
|
||||
\alias{add_indicator_layer}
|
||||
\title{Wrapper around `tmap::tm_polygons()` with sane defaults for plotting indicator values}
|
||||
\usage{
|
||||
add_indicator_layer(
|
||||
poly,
|
||||
col,
|
||||
buffer = NULL,
|
||||
n = 5,
|
||||
style = "pretty",
|
||||
palette = pal_reach("red_5"),
|
||||
as_count = TRUE,
|
||||
color_na = cols_reach("white"),
|
||||
text_na = "Missing data",
|
||||
legend_title = "Proportion (\%)",
|
||||
legend_text_separator = " - ",
|
||||
border_alpha = 1,
|
||||
border_col = cols_reach("lt_grey_1"),
|
||||
lwd = 1,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{poly}{Multipolygon shape defined by sf package.}
|
||||
|
||||
\item{col}{Numeric attribute to map.}
|
||||
|
||||
\item{buffer}{A buffer, either one value or a vector of 4 values (left, bottom, right, top).}
|
||||
|
||||
\item{n}{The desire number of classes.}
|
||||
|
||||
\item{style}{Method to process the color scale for continuous numerical variables. See `classInt::classIntervals()` for details.}
|
||||
|
||||
\item{palette}{Vector of fill colors as hexadecimal values. For REACH color palettes, it is possible to use `pal_reach()`. For now,'palette' must be changed manually, accordingly to the number of drawn classes.}
|
||||
|
||||
\item{as_count}{Boolean. When col is a numeric variable, should it be processed as a count variable? For instance, 0, 1-10, 11-20.}
|
||||
|
||||
\item{color_na}{Fill color for missing data.}
|
||||
|
||||
\item{text_na}{Legend text for missing data.}
|
||||
|
||||
\item{legend_title}{Legend title.}
|
||||
|
||||
\item{legend_text_separator}{Text separator for classes. E.g. " to " will give 0, 1 to 10, 11 to 20.}
|
||||
|
||||
\item{border_alpha}{Transparency of the border.}
|
||||
|
||||
\item{border_col}{Color of the border.}
|
||||
|
||||
\item{lwd}{Linewidth of the border.}
|
||||
|
||||
\item{...}{Other arguments to pass to `tmap::tm_polygons()`.}
|
||||
}
|
||||
\value{
|
||||
A tmap layer.
|
||||
}
|
||||
\description{
|
||||
Wrapper around `tmap::tm_polygons()` with sane defaults for plotting indicator values
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/map.R
|
||||
\name{add_layout}
|
||||
\alias{add_layout}
|
||||
\title{Basic defaults based on `tmap::tm_layout()`}
|
||||
\usage{
|
||||
add_layout(
|
||||
title = NULL,
|
||||
legend_position = c(0.02, 0.5),
|
||||
frame = FALSE,
|
||||
legend_frame = cols_reach("main_grey"),
|
||||
legend_text_size = 0.6,
|
||||
legend_title_size = 0.8,
|
||||
title_size = 0.9,
|
||||
title_fontface = "bold",
|
||||
title_color = cols_reach("main_grey"),
|
||||
fontfamily = "Leelawadee",
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{title}{Map title.}
|
||||
|
||||
\item{legend_position}{Legend position. Not above the map is a good start.}
|
||||
|
||||
\item{frame}{Boolean. Legend frame?}
|
||||
|
||||
\item{legend_frame}{Legend frame color.}
|
||||
|
||||
\item{legend_text_size}{Legend text size in 'pt'.}
|
||||
|
||||
\item{legend_title_size}{Legend title size in 'pt'.}
|
||||
|
||||
\item{title_size}{Title text size in 'pt'.}
|
||||
|
||||
\item{title_fontface}{Title fontface. Bold if you wanna exemplify a lot what it is about.}
|
||||
|
||||
\item{title_color}{Title font color.}
|
||||
|
||||
\item{fontfamily}{Overall fontfamily. Leelawadee is your precious.}
|
||||
|
||||
\item{...}{Other arguments to pass to `tmap::tm_layout()`.}
|
||||
}
|
||||
\value{
|
||||
A tmap layer.
|
||||
}
|
||||
\description{
|
||||
Basic defaults based on `tmap::tm_layout()`
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/map.R
|
||||
\name{add_scale_bar}
|
||||
\alias{add_scale_bar}
|
||||
\title{Add a scale bar}
|
||||
\usage{
|
||||
add_scale_bar(
|
||||
text_size = 0.6,
|
||||
position = c("left", 0.01),
|
||||
color_dark = cols_reach("black"),
|
||||
breaks = c(0, 50, 100),
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{text_size}{Relative font size.}
|
||||
|
||||
\item{position}{Position of the compass. Vector of two values, specifying the x and y coordinates.}
|
||||
|
||||
\item{color_dark}{Color of the dark parts of the compass.}
|
||||
|
||||
\item{breaks}{Breaks of the scale bar. If not specified, breaks will be automatically be chosen given the prefered width of the scale bar. Example: c(0, 50, 100).}
|
||||
|
||||
\item{...}{Other arguments to pass to `tmap::tm_compass()`.}
|
||||
}
|
||||
\value{
|
||||
A tmap layer.
|
||||
}
|
||||
\description{
|
||||
Add a scale bar
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
% 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
|
||||
}
|
||||
42
man/bar.Rd
42
man/bar.Rd
|
|
@ -8,9 +8,9 @@ bar(
|
|||
df,
|
||||
x,
|
||||
y,
|
||||
group = NULL,
|
||||
group = "",
|
||||
add_color = color("dark_grey"),
|
||||
flip = TRUE,
|
||||
percent = TRUE,
|
||||
wrap = NULL,
|
||||
position = "dodge",
|
||||
alpha = 1,
|
||||
|
|
@ -20,24 +20,29 @@ bar(
|
|||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
add_text = FALSE,
|
||||
add_text_suffix = "",
|
||||
theme = theme_reach()
|
||||
width = 0.5,
|
||||
add_text = TRUE,
|
||||
add_text_size = 5,
|
||||
add_text_color = color("dark_grey"),
|
||||
add_text_font_face = "plain",
|
||||
add_text_threshold_display = 0.05,
|
||||
add_text_suffix = "\%",
|
||||
add_text_expand_limit = 1.1
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{df}{A data frame.}
|
||||
|
||||
\item{x}{A numeric column.}
|
||||
\item{x}{A quoted numeric column.}
|
||||
|
||||
\item{y}{A character column or coercible as a character column.}
|
||||
\item{y}{A quoted character column or coercible as a character column.}
|
||||
|
||||
\item{group}{Some grouping categorical column, e.g. administrative areas or population groups.}
|
||||
\item{group}{Some quoted grouping categorical column, e.g. administrative areas or population groups.}
|
||||
|
||||
\item{add_color}{Add a color to bars (if no grouping).}
|
||||
|
||||
\item{flip}{TRUE or FALSE. Default to TRUE or horizontal bar plot.}
|
||||
|
||||
\item{percent}{TRUE or FALSE. Should the x-labels (and text labels if present) be displayed as percentages? Default to TRUE.}
|
||||
|
||||
\item{wrap}{Should x-labels be wrapped? Number of characters.}
|
||||
|
||||
\item{position}{Should the chart be stacked? Default to "dodge". Can take "dodge" and "stack".}
|
||||
|
|
@ -56,14 +61,21 @@ bar(
|
|||
|
||||
\item{caption}{Plot caption. Default to NULL.}
|
||||
|
||||
\item{add_text}{TRUE or FALSE. Add the value as text.}
|
||||
\item{width}{Bar width.}
|
||||
|
||||
\item{add_text}{TRUE or FALSE. Add values as text.}
|
||||
|
||||
\item{add_text_size}{Text size.}
|
||||
|
||||
\item{add_text_color}{Text color.}
|
||||
|
||||
\item{add_text_font_face}{Text font_face.}
|
||||
|
||||
\item{add_text_threshold_display}{Minimum value to add the text label.}
|
||||
|
||||
\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 bar chart
|
||||
\item{add_text_expand_limit}{Default to adding 10% on top of the bar.}
|
||||
}
|
||||
\description{
|
||||
Simple bar chart
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{border_admin0}
|
||||
\alias{border_admin0}
|
||||
\title{Haïti border.}
|
||||
\format{
|
||||
A sf multiline objet with 1 feature and 6 fields:
|
||||
\describe{
|
||||
\item{fid_1}{fid_1}
|
||||
\item{uno}{uno}
|
||||
\item{count}{count}
|
||||
\item{x_coord}{x_coord}
|
||||
\item{y_coord}{y_coord}
|
||||
\item{area}{area}
|
||||
\item{geometry}{Multiline geometry.}
|
||||
}
|
||||
}
|
||||
\usage{
|
||||
border_admin0
|
||||
}
|
||||
\description{
|
||||
A multiline shapefile of Haiti's border.
|
||||
}
|
||||
\keyword{datasets}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/bbox_buffer.R
|
||||
\name{buffer_bbox}
|
||||
\alias{buffer_bbox}
|
||||
\title{Bbbox buffer}
|
||||
\usage{
|
||||
buffer_bbox(sf_obj, buffer = 0)
|
||||
}
|
||||
\arguments{
|
||||
\item{sf_obj}{A `sf` object}
|
||||
|
||||
\item{buffer}{A buffer, either one value or a vector of 4 values (left, bottom, right, top). Default to 0.}
|
||||
}
|
||||
\value{
|
||||
A bbox with a buffer
|
||||
}
|
||||
\description{
|
||||
Bbbox buffer
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{centroid_admin1}
|
||||
\alias{centroid_admin1}
|
||||
\title{Haïti admin 1 centroids shapefile.}
|
||||
\format{
|
||||
A sf multipoint object with 10 features and 9 fields:
|
||||
\describe{
|
||||
\item{ADM1_PC}{Admin 1 postal code.}
|
||||
\item{ADM1_EN}{Full name in English.}
|
||||
\item{ADM1_FR}{Full name in French.}
|
||||
\item{ADM1_HT}{Full name in Haitian Creole.}
|
||||
\item{ADM0_EN}{Country name in English.}
|
||||
\item{ADM0_FR}{Country name in French.}
|
||||
\item{ADM0_HT}{Country name in Haitian Creole.}
|
||||
\item{ADM0_PC}{Country postal code.}
|
||||
\item{ADM1_FR_UPPER}{Admin 1 French name - uppercase.}
|
||||
\item{geometry}{Multipoint geometry.}
|
||||
}
|
||||
}
|
||||
\usage{
|
||||
centroid_admin1
|
||||
}
|
||||
\description{
|
||||
A multipoint shapefile of Haiti's admin 1.
|
||||
}
|
||||
\keyword{datasets}
|
||||
19
man/check_vars_in_df.Rd
Normal file
19
man/check_vars_in_df.Rd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/checks.R
|
||||
\name{check_vars_in_df}
|
||||
\alias{check_vars_in_df}
|
||||
\title{Check if variables are in data frame}
|
||||
\usage{
|
||||
check_vars_in_df(df, vars)
|
||||
}
|
||||
\arguments{
|
||||
\item{df}{A data frame}
|
||||
|
||||
\item{vars}{A vector of variable names}
|
||||
}
|
||||
\value{
|
||||
A stop statement
|
||||
}
|
||||
\description{
|
||||
Check if variables are in data frame
|
||||
}
|
||||
33
man/color.Rd
Normal file
33
man/color.Rd
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/color.R
|
||||
\name{color}
|
||||
\alias{color}
|
||||
\alias{color_pattern}
|
||||
\title{Helpers to extract defined colors as hex codes}
|
||||
\usage{
|
||||
color(..., unname = TRUE)
|
||||
|
||||
color_pattern(pattern, unname = TRUE)
|
||||
}
|
||||
\arguments{
|
||||
\item{...}{Character names of colors. If NULL returns all colors.}
|
||||
|
||||
\item{unname}{Boolean. Should the output vector be unnamed? Default to `TRUE`.}
|
||||
|
||||
\item{pattern}{Pattern of the start of colors' name.}
|
||||
}
|
||||
\value{
|
||||
Hex codes named or unnamed.
|
||||
}
|
||||
\description{
|
||||
[color()] returns the requested columns, returns NA if absent. [color_pattern()] returns all colors that start with the pattern.
|
||||
}
|
||||
\section{Naming of colors}{
|
||||
|
||||
* All branding colors start with "branding";
|
||||
* All , categorical colors start with ", cat_";
|
||||
* All sequential colors start with "seq_";
|
||||
|
||||
Then, a number indi, cates the number of colors that belong to the palettes, a string the name of the palette, and, finally, a number the position of the color. E.g., "seq_5_red_4" would be the 4th color of a continuous palettes of 5 colors in the red band. Exception is made for white, light_grey, dark_grey, and black.
|
||||
}
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/cols_agora.R
|
||||
\name{cols_agora}
|
||||
\alias{cols_agora}
|
||||
\title{Function to extract AGORA colors as hex codes}
|
||||
\usage{
|
||||
cols_agora(..., unnamed = TRUE)
|
||||
}
|
||||
\arguments{
|
||||
\item{...}{Character names of reach colors. If NULL returns all colors}
|
||||
|
||||
\item{unnamed}{Should the output vector be unnamed? Default to `TRUE`}
|
||||
}
|
||||
\value{
|
||||
An hex code or hex codes named or unnamed
|
||||
}
|
||||
\description{
|
||||
Function to extract AGORA colors as hex codes
|
||||
}
|
||||
\details{
|
||||
This function needs to be modified to add colors
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/cols_impact.R
|
||||
\name{cols_impact}
|
||||
\alias{cols_impact}
|
||||
\title{Function to extract IMPACT colors as hex codes}
|
||||
\usage{
|
||||
cols_impact(..., unnamed = TRUE)
|
||||
}
|
||||
\arguments{
|
||||
\item{...}{Character names of reach colors. If NULL returns all colors}
|
||||
|
||||
\item{unnamed}{Should the output vector be unnamed? Default to `TRUE`}
|
||||
}
|
||||
\value{
|
||||
An hex code or hex codes named or unnamed
|
||||
}
|
||||
\description{
|
||||
Function to extract IMPACT colors as hex codes
|
||||
}
|
||||
\details{
|
||||
This function needs to be modified to add colors
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/cols_reach.R
|
||||
\name{cols_reach}
|
||||
\alias{cols_reach}
|
||||
\title{Function to extract REACH colors as hex codes}
|
||||
\usage{
|
||||
cols_reach(..., unnamed = TRUE)
|
||||
}
|
||||
\arguments{
|
||||
\item{...}{Character names of reach colors. If NULL returns all colors}
|
||||
|
||||
\item{unnamed}{Should the output vector be unnamed? Default to `TRUE`}
|
||||
}
|
||||
\value{
|
||||
An hex code or hex codes named or unnamed
|
||||
}
|
||||
\description{
|
||||
Function to extract REACH colors as hex codes
|
||||
}
|
||||
\details{
|
||||
This function needs to be modified to add colors
|
||||
}
|
||||
61
man/donut.Rd
61
man/donut.Rd
|
|
@ -1,61 +0,0 @@
|
|||
% 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
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/dumbbell.R
|
||||
\name{dumbbell}
|
||||
\alias{dumbbell}
|
||||
\title{Make dumbbell chart.}
|
||||
\usage{
|
||||
dumbbell(
|
||||
df,
|
||||
col,
|
||||
group_x,
|
||||
group_y,
|
||||
point_size = 5,
|
||||
point_alpha = 1,
|
||||
segment_size = 2.5,
|
||||
segment_color = cols_reach("main_lt_grey"),
|
||||
group_x_title = NULL,
|
||||
group_y_title = NULL,
|
||||
x_title = NULL,
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
line_to_y_axis = TRUE,
|
||||
line_to_y_axis_type = 3,
|
||||
line_to_y_axis_width = 0.5,
|
||||
line_to_y_axis_color = cols_reach("main_grey"),
|
||||
add_text = TRUE,
|
||||
add_text_vjust = 2,
|
||||
add_text_size = 3.5,
|
||||
add_text_color = cols_reach("main_grey"),
|
||||
theme = theme_reach(palette = "primary")
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{df}{A data frame.}
|
||||
|
||||
\item{col}{A numeric column.}
|
||||
|
||||
\item{group_x}{The grouping column on the x-axis; only two groups.}
|
||||
|
||||
\item{group_y}{The grouping column on the y-axis.}
|
||||
|
||||
\item{point_size}{Point size.}
|
||||
|
||||
\item{point_alpha}{Point alpha.}
|
||||
|
||||
\item{segment_size}{Segment size.}
|
||||
|
||||
\item{segment_color}{Segment color.}
|
||||
|
||||
\item{group_x_title}{X-group and legend title.}
|
||||
|
||||
\item{group_y_title}{Y-axis and group title.}
|
||||
|
||||
\item{x_title}{X-axis title.}
|
||||
|
||||
\item{title}{Title.}
|
||||
|
||||
\item{subtitle}{Subtitle.}
|
||||
|
||||
\item{caption}{Caption.}
|
||||
|
||||
\item{line_to_y_axis}{TRUE or FALSE; add a line connected points and Y-axis.}
|
||||
|
||||
\item{line_to_y_axis_type}{Line to Y-axis type.}
|
||||
|
||||
\item{line_to_y_axis_width}{Line to Y-axis width.}
|
||||
|
||||
\item{line_to_y_axis_color}{Line to Y-axis color.}
|
||||
|
||||
\item{add_text}{TRUE or FALSE; add text at the points.}
|
||||
|
||||
\item{add_text_vjust}{Vertical adjustment.}
|
||||
|
||||
\item{add_text_size}{Text size.}
|
||||
|
||||
\item{add_text_color}{Text color.}
|
||||
|
||||
\item{theme}{A ggplot2 theme, default to `theme_reach()`}
|
||||
}
|
||||
\value{
|
||||
A dumbbell chart.
|
||||
}
|
||||
\description{
|
||||
Make dumbbell chart.
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{frontier_admin0}
|
||||
\alias{frontier_admin0}
|
||||
\title{Haïti frontier with Dominican Republic.}
|
||||
\format{
|
||||
A sf multipoint objet with 4 features and 8 fields:
|
||||
\describe{
|
||||
\item{fid_1}{fid_1}
|
||||
\item{objectid}{objectid}
|
||||
\item{id}{id}
|
||||
\item{fromnode}{fromnode}
|
||||
\item{tonode}{tonode}
|
||||
\item{leftpolygo}{leftpolygo}
|
||||
\item{rightpolygo}{rightpolygo}
|
||||
\item{shape_leng}{shape_leng}
|
||||
\item{geometry}{Multiline geometry.}
|
||||
}
|
||||
}
|
||||
\usage{
|
||||
frontier_admin0
|
||||
}
|
||||
\description{
|
||||
A multiline shapefile of Haiti's frontier with Dominican Republic.
|
||||
}
|
||||
\keyword{datasets}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/internals.R
|
||||
\name{if_not_in_stop}
|
||||
\alias{if_not_in_stop}
|
||||
\title{Stop statement "If not in colnames" with colnames}
|
||||
\usage{
|
||||
if_not_in_stop(.tbl, cols, df, arg = NULL)
|
||||
}
|
||||
\arguments{
|
||||
\item{.tbl}{A tibble}
|
||||
|
||||
\item{cols}{A vector of column names (quoted)}
|
||||
|
||||
\item{df}{Provide the tibble name as a character string}
|
||||
|
||||
\item{arg}{Default to NULL.}
|
||||
}
|
||||
\value{
|
||||
A stop statement
|
||||
}
|
||||
\description{
|
||||
Stop statement "If not in colnames" with colnames
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/internals.R
|
||||
\name{if_vec_not_in_stop}
|
||||
\alias{if_vec_not_in_stop}
|
||||
\title{Stop statement "If not in vector"}
|
||||
\usage{
|
||||
if_vec_not_in_stop(vec, cols, vec_name, arg = NULL)
|
||||
}
|
||||
\arguments{
|
||||
\item{vec}{A vector of character strings}
|
||||
|
||||
\item{cols}{A set of character strings}
|
||||
|
||||
\item{vec_name}{Provide the vector name as a character string}
|
||||
|
||||
\item{arg}{Default to NULL.}
|
||||
}
|
||||
\value{
|
||||
A stop statement if some elements of vec are not in cols
|
||||
}
|
||||
\description{
|
||||
Stop statement "If not in vector"
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{indicator_admin1}
|
||||
\alias{indicator_admin1}
|
||||
\title{Indicator admin 1 polygons shapefile.}
|
||||
\format{
|
||||
A sf multipoint object with 10 features and 10 fields:
|
||||
\describe{
|
||||
\item{ADM1_PC}{Admin 1 postal code.}
|
||||
\item{admin1}{Admin 1 unique id.}
|
||||
\item{opn_dfc}{Proportion of HHs that reported open defecation as sanitation facility.}
|
||||
\item{ADM1_EN}{Full name in English.}
|
||||
\item{ADM1_FR}{Full name in French.}
|
||||
\item{ADM1_HT}{Full name in Haitian Creole.}
|
||||
\item{ADM0_EN}{Country name in English.}
|
||||
\item{ADM0_FR}{Country name in French.}
|
||||
\item{ADM0_HT}{Country name in Haitian Creole.}
|
||||
\item{ADM0_PC}{Country postal code.}
|
||||
\item{geometry}{Multipolygon geometry.}
|
||||
}
|
||||
}
|
||||
\usage{
|
||||
indicator_admin1
|
||||
}
|
||||
\description{
|
||||
A multipolygon shapefile of Haiti's admin 1 with an indicator column 'opn_dfc'.
|
||||
}
|
||||
\keyword{datasets}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/data.R
|
||||
\docType{data}
|
||||
\name{line_admin1}
|
||||
\alias{line_admin1}
|
||||
\title{Haïti admin 1 lines shapefile.}
|
||||
\format{
|
||||
A sf multiline object with 10 features and 8 fields:
|
||||
\describe{
|
||||
\item{ADM1_EN}{Full name in English.}
|
||||
\item{ADM1_FR}{Full name in French.}
|
||||
\item{ADM1_HT}{Full name in Haitian Creole.}
|
||||
\item{ADM0_EN}{Country name in English.}
|
||||
\item{ADM0_FR}{Country name in French.}
|
||||
\item{ADM0_HT}{Country name in Haitian Creole.}
|
||||
\item{ADM0_PCODE}{Country postal code.}
|
||||
\item{geometry}{Multiline geometry.}
|
||||
}
|
||||
}
|
||||
\usage{
|
||||
line_admin1
|
||||
}
|
||||
\description{
|
||||
A multiline shapefile of Haiti's admin 1.
|
||||
}
|
||||
\keyword{datasets}
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
% 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
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/pal_agora.R
|
||||
\name{pal_agora}
|
||||
\alias{pal_agora}
|
||||
\title{Return function to interpolate an AGORA color palette}
|
||||
\usage{
|
||||
pal_agora(
|
||||
palette = "main",
|
||||
reverse = FALSE,
|
||||
color_ramp_palette = FALSE,
|
||||
show_palettes = FALSE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{palette}{Character name of a palette in AGORA palettes}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed}
|
||||
|
||||
\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE`}
|
||||
|
||||
\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`}
|
||||
|
||||
\item{...}{Additional arguments to pass to colorRampPalette()}
|
||||
}
|
||||
\value{
|
||||
A color palette
|
||||
}
|
||||
\description{
|
||||
Return function to interpolate an AGORA color palette
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/pal_fallback.R
|
||||
\name{pal_fallback}
|
||||
\alias{pal_fallback}
|
||||
\title{Return function to interpolate a fallback palette base on viridis::magma()}
|
||||
\usage{
|
||||
pal_fallback(
|
||||
reverse = FALSE,
|
||||
color_ramp_palette = FALSE,
|
||||
discrete = FALSE,
|
||||
n = 5,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed}
|
||||
|
||||
\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the latter with `FALSE`}
|
||||
|
||||
\item{discrete}{Boolean. Discrete or not? Default to FALSE.}
|
||||
|
||||
\item{n}{Number of colors in the palette. Default to 5. Passe to `viridis::magma()`}
|
||||
|
||||
\item{...}{Other parameters to pass to `grDevices::colorRampPalette()`}
|
||||
}
|
||||
\value{
|
||||
A color palette
|
||||
}
|
||||
\description{
|
||||
Return function to interpolate a fallback palette base on viridis::magma()
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/pal_impact.R
|
||||
\name{pal_impact}
|
||||
\alias{pal_impact}
|
||||
\title{Return function to interpolate an IMPACT color palette}
|
||||
\usage{
|
||||
pal_impact(
|
||||
palette = "main",
|
||||
reverse = FALSE,
|
||||
color_ramp_palette = FALSE,
|
||||
show_palettes = FALSE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{palette}{Character name of a palette in IMPACT palettes}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed}
|
||||
|
||||
\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE`}
|
||||
|
||||
\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`}
|
||||
|
||||
\item{...}{Additional arguments to pass to colorRampPalette()}
|
||||
}
|
||||
\value{
|
||||
A color palette
|
||||
}
|
||||
\description{
|
||||
Return function to interpolate an IMPACT color palette
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/pal_reach.R
|
||||
\name{pal_reach}
|
||||
\alias{pal_reach}
|
||||
\title{Return function to interpolate a REACH color palette}
|
||||
\usage{
|
||||
pal_reach(
|
||||
palette = "main",
|
||||
reverse = FALSE,
|
||||
color_ramp_palette = FALSE,
|
||||
show_palettes = FALSE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{palette}{Character name of a palette in REACH palettes}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed}
|
||||
|
||||
\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE`}
|
||||
|
||||
\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`}
|
||||
|
||||
\item{...}{Additional arguments to pass to colorRampPalette()}
|
||||
}
|
||||
\value{
|
||||
A color palette
|
||||
}
|
||||
\description{
|
||||
Return function to interpolate a REACH color palette
|
||||
}
|
||||
23
man/palette.Rd
Normal file
23
man/palette.Rd
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/palette.R
|
||||
\name{palette}
|
||||
\alias{palette}
|
||||
\title{Interpolate a color palette}
|
||||
\usage{
|
||||
palette(palette = "cat_5_main", reverse = FALSE, show_palettes = FALSE, ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{palette}{Character name of a palette in palettes}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed}
|
||||
|
||||
\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`}
|
||||
|
||||
\item{...}{Additional arguments to pass to colorRampPalette()}
|
||||
}
|
||||
\value{
|
||||
A color palette
|
||||
}
|
||||
\description{
|
||||
Interpolate a color palette
|
||||
}
|
||||
26
man/palette_gen.Rd
Normal file
26
man/palette_gen.Rd
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/palette_gen.R
|
||||
\name{palette_gen}
|
||||
\alias{palette_gen}
|
||||
\alias{palette_gen_categorical}
|
||||
\alias{palette_gen_sequential}
|
||||
\title{Generate color palettes}
|
||||
\usage{
|
||||
palette_gen(palette, type, direction = 1, ...)
|
||||
|
||||
palette_gen_categorical(palette = "branding_reach", direction = 1)
|
||||
|
||||
palette_gen_sequential(palette = "seq_7_artichoke", direction = 1, ...)
|
||||
}
|
||||
\arguments{
|
||||
\item{palette}{Palette name from [palette()].}
|
||||
|
||||
\item{type}{"categorical" or "sequential" or "divergent".}
|
||||
|
||||
\item{direction}{1 or -1; should the order of colors be reversed?}
|
||||
|
||||
\item{...}{Additional arguments to pass to [colorRampPalette()] when type is "continuous".}
|
||||
}
|
||||
\description{
|
||||
[palette_gen()] generates a color palette and let you choose whether continuous or discrete. [palette_gen_categorical()] and [palette_gen_sequential()] generates respectively discrete and continuous palettes.
|
||||
}
|
||||
22
man/point.Rd
22
man/point.Rd
|
|
@ -8,17 +8,22 @@ point(
|
|||
df,
|
||||
x,
|
||||
y,
|
||||
group = NULL,
|
||||
group = "",
|
||||
add_color = color("branding_reach_red"),
|
||||
flip = TRUE,
|
||||
alpha = 1,
|
||||
size = 1,
|
||||
size = 2,
|
||||
x_title = NULL,
|
||||
y_title = NULL,
|
||||
group_title = NULL,
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
theme = theme_reach()
|
||||
theme_fun = theme_reach(grid_major_y = TRUE),
|
||||
palette = "cat_5_ibm",
|
||||
scale_impact = TRUE,
|
||||
direction = 1,
|
||||
reverse_guide = TRUE
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
|
|
@ -26,10 +31,12 @@ point(
|
|||
|
||||
\item{x}{A numeric column.}
|
||||
|
||||
\item{y}{A character column or coercible as a character column.}
|
||||
\item{y}{Another numeric column.}
|
||||
|
||||
\item{group}{Some grouping categorical column, e.g. administrative areas or population groups.}
|
||||
|
||||
\item{add_color}{Add a color to bars (if no grouping).}
|
||||
|
||||
\item{flip}{TRUE or FALSE. Default to TRUE or horizontal bar plot.}
|
||||
|
||||
\item{alpha}{Fill transparency.}
|
||||
|
|
@ -48,10 +55,9 @@ point(
|
|||
|
||||
\item{caption}{Plot caption. Default to NULL.}
|
||||
|
||||
\item{theme}{Whatever theme. Default to theme_reach().}
|
||||
}
|
||||
\value{
|
||||
A bar chart
|
||||
\item{theme_fun}{Whatever theme. Default to theme_reach(). NULL if no theming needed.}
|
||||
|
||||
\item{scale_impact}{Use the package custom scales for fill and color.}
|
||||
}
|
||||
\description{
|
||||
Simple point chart
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/scale.R
|
||||
\name{scale_color}
|
||||
\alias{scale_color}
|
||||
\title{Color scale constructor for REACH or AGORA colors}
|
||||
\usage{
|
||||
scale_color(
|
||||
initiative = "reach",
|
||||
palette = "main",
|
||||
discrete = TRUE,
|
||||
reverse = FALSE,
|
||||
reverse_guide = TRUE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{initiative}{Either "reach" or "agora" or "default".}
|
||||
|
||||
\item{palette}{Palette name from `pal_reach()` or `pal_agora()`.}
|
||||
|
||||
\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed.}
|
||||
|
||||
\item{reverse_guide}{Boolean indicating whether the guide should be reversed.}
|
||||
|
||||
\item{...}{Additional arguments passed to discrete_scale() or
|
||||
scale_fill_gradient(), used respectively when discrete is TRUE or FALSE.}
|
||||
}
|
||||
\value{
|
||||
A color scale for ggplot
|
||||
}
|
||||
\description{
|
||||
Color scale constructor for REACH or AGORA colors
|
||||
}
|
||||
49
man/scale_color_visualizer_discrete.Rd
Normal file
49
man/scale_color_visualizer_discrete.Rd
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/scale.R
|
||||
\name{scale_color_visualizer_discrete}
|
||||
\alias{scale_color_visualizer_discrete}
|
||||
\alias{scale_fill_visualizer_discrete}
|
||||
\alias{scale_fill_visualizer_continuous}
|
||||
\alias{scale_color_visualizer_continuous}
|
||||
\title{Scale constructors}
|
||||
\usage{
|
||||
scale_color_visualizer_discrete(
|
||||
palette = "cat_5_main",
|
||||
direction = 1,
|
||||
reverse_guide = TRUE,
|
||||
...
|
||||
)
|
||||
|
||||
scale_fill_visualizer_discrete(
|
||||
palette = "cat_5_main",
|
||||
direction = 1,
|
||||
reverse_guide = TRUE,
|
||||
...
|
||||
)
|
||||
|
||||
scale_fill_visualizer_continuous(
|
||||
palette = "seq_5_main",
|
||||
direction = 1,
|
||||
reverse_guide = TRUE,
|
||||
...
|
||||
)
|
||||
|
||||
scale_color_visualizer_continuous(
|
||||
palette = "seq_5_main",
|
||||
direction = 1,
|
||||
reverse_guide = TRUE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{palette}{Palette name from [palette()].}
|
||||
|
||||
\item{direction}{1 or -1; should the order of colors be reversed?}
|
||||
|
||||
\item{reverse_guide}{Boolean indicating whether the guide should be reversed.}
|
||||
|
||||
\item{...}{Additional arguments passed to [ggplot2::discrete_scale()] if discrete or [ggplot2::scale_fill_gradient()] if continuous.}
|
||||
}
|
||||
\description{
|
||||
Scale constructors
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/scale.R
|
||||
\name{scale_fill}
|
||||
\alias{scale_fill}
|
||||
\title{Fill scale constructor for REACH or AGORA colors}
|
||||
\usage{
|
||||
scale_fill(
|
||||
initiative = "reach",
|
||||
palette = "main",
|
||||
discrete = TRUE,
|
||||
reverse = FALSE,
|
||||
reverse_guide = TRUE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{initiative}{Either "reach" or "agora" or "default".}
|
||||
|
||||
\item{palette}{Palette name from `pal_reach()` or `pal_agora()`.}
|
||||
|
||||
\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed.}
|
||||
|
||||
\item{reverse_guide}{Boolean indicating whether the guide should be reversed.}
|
||||
|
||||
\item{...}{Additional arguments passed to discrete_scale() or
|
||||
scale_fill_gradient(), used respectively when discrete is TRUE or FALSE.}
|
||||
}
|
||||
\value{
|
||||
A fill scale for ggplot.
|
||||
}
|
||||
\description{
|
||||
Fill scale constructor for REACH or AGORA colors
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/internals.R
|
||||
\name{subvec_not_in}
|
||||
\alias{subvec_not_in}
|
||||
\title{Subvec not in}
|
||||
\usage{
|
||||
subvec_not_in(vector, set)
|
||||
}
|
||||
\arguments{
|
||||
\item{vector}{A vector to subset}
|
||||
|
||||
\item{set}{A set-vector}
|
||||
}
|
||||
\value{
|
||||
A subset of vector not in set
|
||||
}
|
||||
\description{
|
||||
Subvec not in
|
||||
}
|
||||
|
|
@ -1,69 +1,65 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/theme_reach.R
|
||||
% Please edit documentation in R/theme.R
|
||||
\name{theme_reach}
|
||||
\alias{theme_reach}
|
||||
\title{ggplot2 theme with REACH color palettes}
|
||||
\title{ggplot2 theme wrapper with REACH fonts and colors}
|
||||
\usage{
|
||||
theme_reach(
|
||||
initiative = "reach",
|
||||
palette = "main",
|
||||
discrete = TRUE,
|
||||
reverse = FALSE,
|
||||
font_family = "Segoe UI",
|
||||
title_size = 12,
|
||||
title_color = cols_reach("main_grey"),
|
||||
font_family = "Carlito",
|
||||
title_size = 16,
|
||||
title_color = color("dark_grey"),
|
||||
title_font_face = "bold",
|
||||
title_hjust = NULL,
|
||||
title_position_to_plot = TRUE,
|
||||
text_size = 10,
|
||||
text_color = cols_reach("main_grey"),
|
||||
title_font_family = "Carlito",
|
||||
text_size = 14,
|
||||
text_color = color("dark_grey"),
|
||||
text_font_face = "plain",
|
||||
panel_background_color = "#FFFFFF",
|
||||
panel_border = FALSE,
|
||||
panel_border_color = cols_reach("main_grey"),
|
||||
legend_position = "right",
|
||||
legend_direction = "vertical",
|
||||
panel_border_color = color("dark_grey"),
|
||||
legend_position = "bottom",
|
||||
legend_direction = "horizontal",
|
||||
legend_justification = "left",
|
||||
legend_reverse = TRUE,
|
||||
legend_title_size = 11,
|
||||
legend_title_color = cols_reach("main_grey"),
|
||||
legend_title_size = 14,
|
||||
legend_title_color = color("dark_grey"),
|
||||
legend_title_font_face = "plain",
|
||||
legend_text_size = 10,
|
||||
legend_text_color = cols_reach("main_grey"),
|
||||
legend_text_size = 12,
|
||||
legend_text_color = color("dark_grey"),
|
||||
legend_text_font_face = "plain",
|
||||
axis_x = TRUE,
|
||||
axis_y = TRUE,
|
||||
axis_text_size = 10,
|
||||
axis_text_color = cols_reach("main_grey"),
|
||||
axis_text_x = TRUE,
|
||||
axis_line_x = TRUE,
|
||||
axis_ticks_x = TRUE,
|
||||
axis_text_y = TRUE,
|
||||
axis_line_y = TRUE,
|
||||
axis_ticks_y = TRUE,
|
||||
axis_text_size = 14,
|
||||
axis_text_color = color("dark_grey"),
|
||||
axis_text_font_face = "plain",
|
||||
axis_title_size = 11,
|
||||
axis_title_color = cols_reach("main_grey"),
|
||||
axis_title_font_face = "bold",
|
||||
axis_title_size = 15,
|
||||
axis_title_color = color("dark_grey"),
|
||||
axis_title_font_face = "plain",
|
||||
axis_text_x_angle = 0,
|
||||
axis_text_x_vjust = 0.5,
|
||||
axis_text_x_hjust = 0.5,
|
||||
grid_major_x = FALSE,
|
||||
grid_major_x = TRUE,
|
||||
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_major_color = color("light_grey"),
|
||||
grid_major_x_size = 0.01,
|
||||
grid_major_y_size = 0.01,
|
||||
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,
|
||||
grid_minor_color = color("light_grey"),
|
||||
grid_minor_x_size = 0.005,
|
||||
grid_minor_y_size = 0.005,
|
||||
caption_position_to_plot = TRUE,
|
||||
...
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{initiative}{Either "reach" or "default".}
|
||||
|
||||
\item{palette}{Palette name from 'pal_reach()'.}
|
||||
|
||||
\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.}
|
||||
|
||||
\item{reverse}{Boolean indicating whether the palette should be reversed.}
|
||||
|
||||
\item{font_family}{The font family for all plot's texts. Default to "Segoe UI".}
|
||||
|
||||
\item{title_size}{The size of the legend title. Defaults to 11.}
|
||||
|
|
@ -76,6 +72,8 @@ theme_reach(
|
|||
|
||||
\item{title_position_to_plot}{TRUE or FALSE. Positioning to plot or to panel?}
|
||||
|
||||
\item{title_font_family}{Title font family. Default to "Roboto Condensed".}
|
||||
|
||||
\item{text_size}{The size of all text other than the title, subtitle and caption. Defaults to 10.}
|
||||
|
||||
\item{text_color}{Text color.}
|
||||
|
|
@ -92,6 +90,8 @@ theme_reach(
|
|||
|
||||
\item{legend_direction}{Direction of the legend. Default to "vertical". Can take "vertical" or "horizontal".}
|
||||
|
||||
\item{legend_justification}{In addition to legend_direction, place the legend. Can take "left", "bottom", "center", "right", "top".}
|
||||
|
||||
\item{legend_reverse}{Reverse the color in the guide? Default to TRUE.}
|
||||
|
||||
\item{legend_title_size}{Legend title size.}
|
||||
|
|
@ -110,6 +110,18 @@ theme_reach(
|
|||
|
||||
\item{axis_y}{Boolean. Do you need y-axis?}
|
||||
|
||||
\item{axis_text_x}{Boolean. Do you need the text for the x-axis?}
|
||||
|
||||
\item{axis_line_x}{Boolean. Do you need the line for the x-axis?}
|
||||
|
||||
\item{axis_ticks_x}{Boolean. Do you need the line for the x-axis?}
|
||||
|
||||
\item{axis_text_y}{Boolean. Do you need the text for the y-axis?}
|
||||
|
||||
\item{axis_line_y}{Boolean. Do you need the line for the y-axis?}
|
||||
|
||||
\item{axis_ticks_y}{Boolean. Do you need the line for the y-axis?}
|
||||
|
||||
\item{axis_text_size}{Axis text size.}
|
||||
|
||||
\item{axis_text_color}{Axis text color.}
|
||||
|
|
@ -150,10 +162,7 @@ theme_reach(
|
|||
|
||||
\item{caption_position_to_plot}{TRUE or FALSE. Positioning to plot or to panel?}
|
||||
|
||||
\item{...}{Additional arguments passed to `ggplot2::gg_theme()`.}
|
||||
}
|
||||
\value{
|
||||
The base REACH theme
|
||||
\item{...}{Additional arguments passed to [ggplot2::theme()].}
|
||||
}
|
||||
\description{
|
||||
Give some reach colors and fonts to a ggplot.
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/visualizeR-package.R
|
||||
\docType{package}
|
||||
\name{visualizeR-package}
|
||||
\alias{visualizeR}
|
||||
\alias{visualizeR-package}
|
||||
\title{visualizeR: What a color! What a viz!}
|
||||
\description{
|
||||
\if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}}
|
||||
|
||||
It basically provides colors as hex codes, color palettes, and some viz functions (graphs and maps).
|
||||
}
|
||||
\seealso{
|
||||
Useful links:
|
||||
\itemize{
|
||||
\item \url{https://github.com/gnoblet/visualizeR}
|
||||
\item \url{https://gnoblet.github.io/visualizeR/}
|
||||
}
|
||||
|
||||
}
|
||||
\author{
|
||||
\strong{Maintainer}: Noblet Guillaume \email{gnoblet@zaclys.net}
|
||||
|
||||
}
|
||||
\keyword{internal}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/waffle.R
|
||||
\name{waffle}
|
||||
\alias{waffle}
|
||||
\title{Simple waffle chart}
|
||||
\usage{
|
||||
waffle(
|
||||
df,
|
||||
x,
|
||||
y,
|
||||
n_rows = 10,
|
||||
size = 2,
|
||||
x_title = NULL,
|
||||
x_lab = NULL,
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
caption = NULL,
|
||||
arrange = TRUE,
|
||||
theme = theme_reach(axis_x = FALSE, axis_y = FALSE, legend_position = "bottom",
|
||||
legend_direction = "horizontal", title_hjust = 0.5)
|
||||
)
|
||||
}
|
||||
\arguments{
|
||||
\item{df}{A data frame.}
|
||||
|
||||
\item{x}{A character column or coercible as a character column. Will give the waffle's fill color.}
|
||||
|
||||
\item{y}{A numeric column (if plotting proportion, make sure to have percentages between 0 and 100 and not 0 and 1).}
|
||||
|
||||
\item{n_rows}{Number of rows. Default to 10.}
|
||||
|
||||
\item{size}{Width of the separator between blocks (defaults to 2).}
|
||||
|
||||
\item{x_title}{The x scale title. Default to NULL.}
|
||||
|
||||
\item{x_lab}{The x scale caption. 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{theme}{Whatever theme. Default to theme_reach().}
|
||||
}
|
||||
\value{
|
||||
A waffle chart
|
||||
}
|
||||
\description{
|
||||
Simple waffle chart
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue