% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/estat.R
\name{collect.estat}
\alias{collect.estat}
\alias{collect.tbl_estat}
\title{Collect data from an 'e-Stat' table}
\usage{
\method{collect}{estat}(x, n = "n", names_sep = "_", query = list(), limit = 100000L, ...)

\method{collect}{tbl_estat}(x, ...)
}
\arguments{
\item{x}{An \code{estat} or \code{tbl_estat} object.}

\item{n}{Name of the column that holds the observed values.}

\item{names_sep}{Separator used to combine a classification's key
(e.g. \code{"area"}) with its selected columns (e.g. \code{"name"}) into new
column names (e.g. \code{"area_name"}).}

\item{query}{A list of additional queries passed to 'e-Stat's
\code{getStatsData} API.}

\item{limit}{Maximum number of records requested per page. 'e-Stat'
caps this at 100000.}

\item{...}{Ignored.}
}
\value{
A \code{tibble}.
}
\description{
\code{collect()} downloads the statistical values selected from an \code{estat}
object with \code{dplyr::filter()}, \code{dplyr::select()}, and
\code{\link[navigatr:rekey]{navigatr::rekey()}}, and returns them as a tidy \code{tibble}. Large tables
are paginated automatically.
}
\examples{
\dontrun{
Sys.setenv(ESTAT_API_KEY = "Your API key")
estat("https://www.e-stat.go.jp/dbview?sid=0003433219") |>
  dplyr::collect()
}

}
