Update documentation and check arg error in hbar*() functions

This commit is contained in:
gnoblet 2022-05-14 10:20:14 -04:00
parent 7d170d11ba
commit 4811f00b3f
40 changed files with 1057 additions and 51 deletions

21
man/abort_bad_argument.Rd Normal file
View file

@ -0,0 +1,21 @@
% 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
}

19
man/buffer_bbox.Rd Normal file
View file

@ -0,0 +1,19 @@
% 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
}

49
man/hbar.Rd Normal file
View file

@ -0,0 +1,49 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hbar.R
\name{hbar}
\alias{hbar}
\title{Simple horizontal bar chart}
\usage{
hbar(
.tbl,
x,
y,
group = NULL,
initiative = "reach",
x_title = "",
y_title = "",
group_title = NULL,
font_family = "Leelawadee",
stack = FALSE,
...
)
}
\arguments{
\item{.tbl}{Some data}
\item{x}{Some numeric column on the x scale}
\item{y}{Some column on the y scale}
\item{group}{Some grouping categorical column, e.g. administrative areas}
\item{initiative}{Either "reach" or "agora" or "impact" for the color palette}
\item{x_title}{The x scale title. Default to empty string}
\item{y_title}{The y scale title. Default to empty string}
\item{group_title}{The group legend title. Defaut to NULL}
\item{font_family}{The font family. Default to "Leelawadee"}
\item{stack}{Should the chart be stacked? Default to "FALSE" (dodge)}
\item{...}{Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"}
}
\value{
A horizontal bar chart
}
\description{
without any change to the x scale
}

49
man/hbar_percent.Rd Normal file
View file

@ -0,0 +1,49 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hbar.R
\name{hbar_percent}
\alias{hbar_percent}
\title{Simple horizontal bar chart}
\usage{
hbar_percent(
.tbl,
x,
y,
group = NULL,
initiative = "reach",
x_title = "",
y_title = "",
group_title = NULL,
font_family = "Leelawadee",
stack = FALSE,
...
)
}
\arguments{
\item{.tbl}{Some data}
\item{x}{Some numeric column on the x scale}
\item{y}{Some column on the y scale}
\item{group}{Some grouping categorical column, e.g. administrative areas}
\item{initiative}{Either "reach" or "agora" or "impact" for the color palette}
\item{x_title}{The x scale title. Default to empty string}
\item{y_title}{The y scale title. Default to empty string}
\item{group_title}{The group legend title. Defaut to NULL}
\item{font_family}{The font family. Default to "Leelawadee"}
\item{stack}{Should the chart be stacked? Default to "FALSE" (dodge)}
\item{...}{Other arguments to be passed to "simplevis::gg_hbar" or "simplevis:gg_hbar_col"}
}
\value{
A horizontal bar chart
}
\description{
with nice percentage x labels
}

23
man/if_not_in_stop.Rd Normal file
View file

@ -0,0 +1,23 @@
% 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
}

23
man/if_vec_not_in_stop.Rd Normal file
View file

@ -0,0 +1,23 @@
% 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"
}

19
man/subvec_not_in.Rd Normal file
View file

@ -0,0 +1,19 @@
% 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
}

View file

@ -2,7 +2,7 @@
% Please edit documentation in R/theme_reach.R
\name{theme_reach_flip_hist}
\alias{theme_reach_flip_hist}
\title{Some reach more minimal theme for ggplot}
\title{Some reach more minimal theme for a ggplot flipped histogram}
\usage{
theme_reach_flip_hist(family = "Leelawadee")
}

View file

@ -2,7 +2,7 @@
% Please edit documentation in R/theme_reach.R
\name{theme_reach_hist}
\alias{theme_reach_hist}
\title{Some reach more minimal theme for ggplot}
\title{Some reach more minimal theme for a ggplot histogram}
\usage{
theme_reach_hist(family = "Leelawadee")
}