% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{wid_plot_compare}
\alias{wid_plot_compare}
\title{Cross-country comparison bar/point chart}
\usage{
wid_plot_compare(
  data,
  year = NULL,
  variable = NULL,
  country = NULL,
  country_labels = NULL,
  type = "bar"
)
}
\arguments{
\item{data}{A \code{wid_df}.}

\item{year}{Integer year (defaults to most recent common year).}

\item{variable}{Variable code to plot.}

\item{country}{Country codes to include.}

\item{country_labels}{Named character vector for renaming countries.}

\item{type}{\code{"bar"} (default) or \code{"point"}.}
}
\value{
A \code{ggplot} object.
}
\description{
Cross-country comparison bar/point chart
}
\examples{
\donttest{
  d <- data.frame(
    country = rep(c("US", "FR"), each = 3L),
    year    = rep(c("2018", "2019", "2020"), 2L),
    variable = "sptinc992j", percentile = "p99p100",
    value = c(0.20, 0.19, 0.19, 0.11, 0.11, 0.12),
    age = "992", pop = "j", stringsAsFactors = FALSE
  )
  class(d) <- c("wid_df", "data.frame")
  wid_plot_compare(d, year = 2020)
}
}
