% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/statCanR.R
\name{statcan_data}
\alias{statcan_data}
\title{Download a Statistics Canada data table}
\usage{
statcan_data(tableNumber, lang)
}
\arguments{
\item{tableNumber}{A Statistics Canada table number or Product ID. Both
\code{"27-10-0014-01"} and \code{"27100014"} are accepted.}

\item{lang}{Language of the downloaded table: \code{"eng"} or \code{"fra"}.}
}
\value{
A data frame containing the complete Statistics Canada table.
}
\description{
Downloads a complete table from Statistics Canada's Web Data Service (WDS)
and returns it as a data frame. Product IDs can be supplied in the familiar
hyphenated form (for example, \code{"27-10-0014-01"}) or as an eight-digit PID
(for example, \code{"27100014"}).
}
\details{
The function keeps the interface used by earlier statcanR releases. English
and French downloads share the same processing rules. In particular, the
first column is named \code{REF_DATE}, coordinates are stored as character, and
the table title from the metadata file is added as \code{INDICATOR}.
}
\examples{
\dontrun{
science <- statcan_data("27-10-0014-01", "eng")
science_fr <- statcan_data("27100014", "fra")
}
}
