Skip to contents

[Maturing]

This function downloads data from the Brazilian Institute of Geography and Statistics (IBGE) Automatic Retrieval System (SIDRA) API for a given range of years.

Usage

get_and_aggregate_sidra_by_year(years, api_start, api_end, year_col = "Ano")

Arguments

years

A integerish vector with the years to download.

api_start

A string with the start of the API URL.

api_end

A string with the end of the API URL. It's important to note that the year will be pasted after api_start and before api_end.

year_col

A string with the name of the column that contains the year.

Value

A tibble with data from the SIDRA API.

Details

To get the API call, go to the SIDRA, look for your data in one of the tables, then click on the share button and copy the Parâmetros para a API value. The API call starts with "/t" (see the examples).

Examples

if (FALSE) { # \dontrun{
  sidrar_aggregator(
    years = 2010:2011,
    api_start = "/t/1612/n6/all/v/109/p/",
    api_end = "/c81/2692"
  )
} # }