Learn R Programming

inegiR (version 2.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, token, metadata = FALSE, coerce = TRUE)

inegi_series_json(series, token, metadata = FALSE, coerce = TRUE)

Arguments

series

Vector with complete url in character, obtained via INEGI

token

API token supplied by INEGI

metadata

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

coerce

Defaults to TRUE. The bi-weekly indicators will be coerced to monthly. All observations will be kept but in the same day of the month.

Value

data.frame or list

Examples

Run this code
# NOT RUN {
# General INPC series
token<-"webservice_token"
url <- "http://www3.inegi.org.mx/sistemas/api/indicadores/v1//Indicador/216064/00000/es/false/xml/"
INPC <- inegi_series(url, token)
# }

Run the code above in your browser using DataLab