% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lpr_hist.R
\name{lpr_hist}
\alias{lpr_hist}
\title{LAPOP Bar/Histogram Graphs}
\usage{
lpr_hist(
  data,
  outcome,
  filesave = "",
  cfmt = "",
  sort = "xv",
  order = "lo-hi",
  keep_nr = FALSE
)
}
\arguments{
\item{data}{A survey object.  The data that should be analyzed.}

\item{outcome}{Character. Outcome variable of interest.}

\item{filesave}{Character.  Path and file name to save the dataframe as csv.}

\item{cfmt}{Character. Changes the format of the numbers displayed above the bars.
Uses sprintf string formatting syntax. Default is whole numbers.}

\item{sort}{Character. On what value the bars are sorted.
Options are "y" (for the value of the outcome variable), "xv" (default; for
the underlying values of the x variable), "xl" (for the labels of the x variable,
i.e., alphabetical).}

\item{order}{Character.  How the bars should be sorted.  Options are "hi-lo"
or "lo-hi" (default).}

\item{keep_nr}{Logical.  If TRUE, will convert "don't know" (missing code .a)
and "no response" (missing code .b) into valid data (value = 99).
The default is to examine valid responses only.  Default: FALSE.}
}
\value{
Returns a data frame, with data formatted for visualization by lapop_hist
}
\description{
This function creates dataframes which can then be input in lapop_hist for
showing a bar graph using LAPOP formatting.
}
\examples{

require(lapop); data(bra23)

# Set Survey Context: single country and year (requires wt = T)
bra23lpr <- lpr_data(bra23, wt = TRUE)

lpr_hist(bra23lpr,
outcome = "ing4",
sort = "xv",
order = "hi-lo")

}
\author{
Shashwat Dhar \email{shashwat.dhar@vanderbilt.edu} & Luke Plutowski, \email{luke.plutowski@vanderbilt.edu}
}
