get_bcch_data: Fetch data using an .iqy file from the BCCh

View source: R/get_BCCh_data.R

get_bcch_dataR Documentation

Fetch data using an .iqy file from the BCCh

Description

get_bcch_data parses an .iqy file generated by the Statistical Database of the Central Bank of Chile (BCCh), gets the required data from their server, and returns it as a data frame.

Usage

get_bcch_data(path_to_iqy, q_values, ...)

Arguments

path_to_iqy

the path to the .iqy file. Can be a relative path.

q_values

a character vector (or something that can be coerced to it). Should contain the values for every parameter in the query, in adequate order. Parameters are almost always start and end date, but use only if you are sure of this. If missing, the program will ask the user to input these values.

...

arguments passed to httr::POST. For example, you can pass httr::timeout(20) to wait 20 seconds for the response if the default is not enough.

Value

A data frame containing the requested data and with the following attributes:

  1. data_def: definition of the data requested

  2. data_types: type of data stored in each column

See Also

Vist the BCCh database at https://si3.bcentral.cl/siete.

Examples


## Not run: 
# this should ask the user for a start and an end date
get_bcch_data("UF_IVP_DIARIO.iqy")

## End(Not run)


miguelbiron/BCChqRy documentation built on Sept. 17, 2022, 3:40 a.m.