wpa/man/create_bar.Rd

77 строки
2.4 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create_bar.R
\name{create_bar}
\alias{create_bar}
\title{Mean Bar Plot for any metric}
\usage{
create_bar(
data,
metric,
hrvar = "Organization",
mingroup = 5,
return = "plot",
bar_colour = "default",
na.rm = FALSE
)
}
\arguments{
\item{data}{A Standard Person Query dataset in the form of a data frame.}
\item{metric}{Character string containing the name of the metric,
e.g. "Collaboration_hours"}
\item{hrvar}{HR Variable by which to split metrics, defaults to "Organization"
but accepts any character vector, e.g. "LevelDesignation"}
\item{mingroup}{Numeric value setting the privacy threshold / minimum group size. Defaults to 5.}
\item{return}{String specifying what to return. This must be one of the following strings:
\itemize{
\item \code{"plot"}
\item \code{"table"}
}
See \code{Value} for more information.}
\item{bar_colour}{String to specify colour to use for bars.
In-built accepted values include \code{"default"} (default), \code{"alert"} (red), and
\code{"darkblue"}. Otherwise, hex codes are also accepted. You can also supply
RGB values via \code{rgb2hex()}.}
\item{na.rm}{A logical value indicating whether \code{NA} should be stripped
before the computation proceeds. Defaults to \code{FALSE}.}
}
\value{
A different output is returned depending on the value passed to the \code{return} argument:
\itemize{
\item \code{"plot"}: ggplot object. A bar plot for the metric.
\item \code{"table"}: data frame. A summary table for the metric.
}
}
\description{
Provides an overview analysis of a selected metric by calculating a mean per metric.
Returns a bar plot showing the average of a selected metric by default.
Additional options available to return a summary table.
}
\examples{
# Return a ggplot bar chart
create_bar(sq_data, metric = "Collaboration_hours", hrvar = "LevelDesignation")
create_bar(sq_data, metric = "Generated_workload_email_hours")
create_bar(sq_data, metric = "After_hours_collaboration_hours")
# Return a summary table
create_bar(sq_data, metric = "Collaboration_hours", hrvar = "LevelDesignation", return = "table")
}
\seealso{
Other General:
\code{\link{create_bar_asis}()},
\code{\link{create_boxplot}()},
\code{\link{create_bubble}()},
\code{\link{create_scatter}()},
\code{\link{cut_hour}()},
\code{\link{extract_hr}()},
\code{\link{hrvar_count}()},
\code{\link{identify_outlier}()}
}
\concept{General}