% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/inequality.R
\name{wid_top_share}
\alias{wid_top_share}
\title{Top income or wealth share}
\usage{
wid_top_share(data, top = 0.1, variable = NULL, country = NULL)
}
\arguments{
\item{data}{A \code{wid_df} with share series.}

\item{top}{Top fraction, e.g. 0.1 = top 10\\\%.}

\item{variable}{Variable code filter.}

\item{country}{Country code filter.}
}
\value{
A \code{data.frame} with columns \code{country}, \code{year},
\code{top} (the requested fractile), and \code{share} (numeric).
}
\description{
Top income or wealth share
}
\examples{
d <- data.frame(
  country = "US", year = "2020", variable = "sptinc992j",
  percentile = "p99p100", value = 0.19, age = "992", pop = "j",
  stringsAsFactors = FALSE
)
class(d) <- c("wid_df", "data.frame")
wid_top_share(d, top = 0.01)
}
