% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_pyr.R
\name{plot_pyr}
\alias{plot_pyr}
\title{Plot population pyramid}
\usage{
plot_pyr(
  popm,
  popf,
  popm2 = NULL,
  popf2 = NULL,
  age,
  prc = FALSE,
  sexn = c("Males", "Females"),
  sexc = c("#ED0000B2", "#00468BB2"),
  age.cont = NULL,
  un.intervals = TRUE
)
}
\arguments{
\item{popm}{Numeric vector of male population}

\item{popf}{Numeric vector of female population}

\item{popm2}{Optional. Numeric vector of second male population to be plotted as line.}

\item{popf2}{Optional. Numeric vector of second female population to be plotted as line.}

\item{age}{Numeric vector of ages}

\item{prc}{Should the population be shown as a percentage rather than in absolute terms? By default, it is \code{FALSE} and the plot shows user-specific values in \code{popm} and \code{popf}.}

\item{sexn}{Character array of labels for the sexes. By default = \code{c("Males", "Females")}}

\item{sexc}{Character array of colors for the sexes. By default = \code{c("#ED0000B2","#00468BB2")}, which are red and blue}

\item{age.cont}{Optional. Logical. Should the age axis be considered as continuous scale? Recommend to switch to \code{TRUE} if the age intervals are small (1 year) and \code{FALSE} otherwise (for ex., when age interval is 5 years). By default function chooses the value by itself.}

\item{un.intervals}{Logical. Should the age groups be unified? For example, if the first and second groups are 0-1, 1-4, and all other groups are five-year, the function automatically makes the group 1-4 to make all the intervals the same. By default, \code{TRUE}.}
}
\value{
A \code{ggplot2} object representing a population pyramid. If \code{popm2} and
\code{popf2} are supplied, the plot also includes dashed comparison lines for
the second population.
}
\description{
Plot population pyramid
}
\examples{
plot_pyr(
  popm = c(100, 90, 80, 70, 60),
  popf = c(95, 92, 85, 75, 65),
  age = seq(0, 20, 5)
)
}
