get_ine_data: Get data from the INE API

View source: R/get_ine_data.R

get_ine_dataR Documentation

Get data from the INE API

Description

[Experimental]
Return tidy data frames from Instituto Nacional de EstatĂ­stica API

Usage

get_ine_data(
  indicator,
  lang = "PT",
  expected.duration = FALSE,
  max_cells = 30000,
  ...
)

Arguments

indicator

INE indicator ID as a 7 character string. Example: "0010003".

lang

One of "PT" or "EN". Default is "PT".

expected.duration

If TRUE, prints the expected remaining duration in the console.

max_cells

Integer smaller than or equal to 40000, the maximum number of cells allowed in each API call. Default value of 30000

...

Values for each Dimension of the indicator. Each parameter should be in the form dimN, with N one of {1, ..., NÂș of dimensions}. If one of the dimensions is not included, output includes all values for that dimension.

Details

Extraction time can be very high (many hours) for indicators with many dimensions and/or many unique values. E.g. Indicator "0008206 - Deaths by Place of residence, Sex, Age group and Death cause, Annual" will take many hours to extract.

Value

tidy data frame for the given indicator.

See Also

get_dim_values() can be used to identify the values to be passed to dimN parameters, in the variable categ_cod. See this vignette for further clarification on how to obtain only a subset of the data.

Examples

#A simple example. Returns the complete dataset.
get_ine_data("0011823")
# A more complex example. Returns a subset of the dataset.

get_ine_data("0008206", dim1 = "S7A1996", dim2 = c("11","111"),
             dim4 = c(1,19), dim5 = "TLES")


ineptR documentation built on Sept. 8, 2023, 5:44 p.m.