Learn R Programming

inegiR (version 3.0.0)

inegi_series: Returns INEGI data series

Description

Returns a data.frame with the time series chosen from INEGI webservice. If the parameter Metadata is TRUE, a list is returned with two objects: data and metadata.

Usage

inegi_series(series_id, token, geography = "00", database = "BIE",
  metadata = FALSE, lastonly = FALSE, as_tt = FALSE,
  as_compact = FALSE)

Arguments

series_id

an indicator ID. These are obtained via the INEGI API documentation.

token

API token supplied by INEGI.

geography

Geography code of INEGI. Defaults to 00 (National)

database

Is the id from BIE (Banco de Informacion Economica) or BISE (Banco de Indicadores)? Defaults to BIE. To learn more about what database your indicator is stored in, visit INEGI docs.

metadata

Defaults to FALSE, if TRUE, returns a list with metadata information.

lastonly

Do you want only the last observation? Defaults to FALSE.

as_tt

Do you want the output of the data.frame to be a tibble time object? Defaults to FALSE.

as_compact

Do you want the output always as a data.frame or time tibble? If the output contains metadata, each data point will be replicated in a column. If the output does not contain metadata there is no change. Previously, this was achieved with compact_inegi_series.

Value

data.frame or list

Examples

Run this code
# NOT RUN {
# General INPC series
token <- "webservice_token"
inpc_id <- "216064"
INPC <- inegi_series(inpc_id, token)
# }

Run the code above in your browser using DataLab