67 lines
1.5 KiB
R
67 lines
1.5 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/bar.R
|
|
\name{bar}
|
|
\alias{bar}
|
|
\title{Simple bar chart}
|
|
\usage{
|
|
bar(
|
|
df,
|
|
x,
|
|
y,
|
|
group = NULL,
|
|
flip = TRUE,
|
|
percent = TRUE,
|
|
position = "dodge",
|
|
alpha = 1,
|
|
x_title = NULL,
|
|
y_title = NULL,
|
|
group_title = NULL,
|
|
title = NULL,
|
|
subtitle = NULL,
|
|
caption = NULL,
|
|
add_text = FALSE,
|
|
add_text_suffix = "",
|
|
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{group}{Some grouping categorical column, e.g. administrative areas or population groups.}
|
|
|
|
\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{position}{Should the chart be stacked? Default to "dodge". Can take "dodge" and "stack".}
|
|
|
|
\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{group_title}{The group legend 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 value as text.}
|
|
|
|
\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
|
|
}
|
|
\description{
|
|
Simple bar chart
|
|
}
|