Title: | Access to RFR (Risk-Free Rate) Curves Produced by the EIOPA |
---|---|
Description: | Provides EIOPA (European Insurance And Occupational Pensions Authority) risk-free rates. Please note that the author of this package is not affiliated with EIOPA. The data is accessed through a REST API available at <https://mehdiechchelh.com/api/>. |
Authors: | Mehdi Echchelh [aut, cre] |
Maintainer: | Mehdi Echchelh <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2025-02-03 03:08:36 UTC |
Source: | https://github.com/mehdichelh/eiopar |
Base URL to the API.
API_BASE_URL()
API_BASE_URL()
A string: the base URL to the API.
This function is a helper to make get requests to the API.
api_get(path)
api_get(path)
path |
the path to an endpoint of the API |
A list of class "eiopaR_api". It has at least the following components:
the JSON content parsed to a list.
the path to the requested endpoint.
the raw response.
Returns the available options for a specific field.
get_options(field)
get_options(field)
field |
a string like "region", "year" or "month" |
A vector of type "character": the list of the available options for field
.
## Not run: get_options("region") ## End(Not run)
## Not run: get_options("region") ## End(Not run)
This function query and returns the EIOPA risk-free interest rate term structures from an API.
Note: this function is getting the data from an API. Your IP can be temporary or permanently blocked if too many queries are executed.
For optimal performance, we recommend to limit the number of calls to this function.
EIOPA website : https://www.eiopa.europa.eu/tools-and-data/risk-free-interest-rate-term-structures_en
get_rfr( type = options_rfr_types(), region, year = NULL, month = NULL, format = c("data.frame") )
get_rfr( type = options_rfr_types(), region, year = NULL, month = NULL, format = c("data.frame") )
type |
the type of the risk-free rate, see |
region |
the region to query (examples: "FR". see |
year |
the year of the RFR. |
month |
the month of the RFR. |
format |
the format for the output data. Currently the only option is "data.frame". |
A list of class "eiopa_rfr", with components:
a data.frame containing the risk-free rate curves.
a data.frame containing metadata about the risk-free rate curves.
get_rfr_with_va, get_rfr_no_va
## Not run: get_rfr("with_va", "FR", 2019, 12) get_rfr("no_va", "FR", c(2016, 2019), 12) ## End(Not run)
## Not run: get_rfr("with_va", "FR", 2019, 12) get_rfr("no_va", "FR", c(2016, 2019), 12) ## End(Not run)
This function query and returns the EIOPA risk-free interest rate term structures from an API.
Note: this function is getting the data from an API. Your IP can be temporary or permanently blocked if too many queries are executed.
For optimal performance, we recommend to limit the number of calls to this function.
EIOPA website : https://www.eiopa.europa.eu/tools-and-data/risk-free-interest-rate-term-structures_en
get_rfr_no_va(region, year = NULL, month = NULL, format = c("data.frame"))
get_rfr_no_va(region, year = NULL, month = NULL, format = c("data.frame"))
region |
the region to query (examples: "FR". see |
year |
the year of the RFR. |
month |
the month of the RFR. |
format |
the format for the output data. Currently the only option is "data.frame". |
A list of class "eiopa_rfr", with at least the following components:
a data.frame containing the risk-free rate curves.
a data.frame containing metadata about the risk-free rate curves.
get_rfr, get_rfr_with_va
## Not run: get_rfr_no_va("FR", 2019, 12) get_rfr_no_va("BE", 2020, 11) ## End(Not run)
## Not run: get_rfr_no_va("FR", 2019, 12) get_rfr_no_va("BE", 2020, 11) ## End(Not run)
This function query and returns the EIOPA risk-free interest rate term structures from an API.
Note: this function is getting the data from an API. Your IP can be temporary or permanently blocked if too many queries are executed.
For optimal performance, we recommend to limit the number of calls to this function.
EIOPA website : https://www.eiopa.europa.eu/tools-and-data/risk-free-interest-rate-term-structures_en
get_rfr_with_va(region, year = NULL, month = NULL, format = c("data.frame"))
get_rfr_with_va(region, year = NULL, month = NULL, format = c("data.frame"))
region |
the region to query (examples: "FR". see |
year |
the year of the RFR. |
month |
the month of the RFR. |
format |
the format for the output data. Currently the only option is "data.frame". |
A list of class "eiopa_rfr", with components:
a data.frame containing the risk-free rate curves.
a data.frame containing metadata about the risk-free rate curves.
get_rfr, get_rfr_no_va
## Not run: get_rfr_with_va("FR", 2019, 12) get_rfr_with_va("BE", 2020, 11) ## End(Not run)
## Not run: get_rfr_with_va("FR", 2019, 12) get_rfr_with_va("BE", 2020, 11) ## End(Not run)
This function returns a list of the available options for the risk-free-rates curves.
(see argument "type" for get_rfr
)
options_rfr_types()
options_rfr_types()
vector of strings: the different options available.
get_rfr
options_rfr_types()
options_rfr_types()
This function is used to parse data received from the API to various formats.
parse_rfr(resp, format)
parse_rfr(resp, format)
resp |
A response from the API (status 200, type/JSON). The response should have a "data" keyword with the value of an array containing the risk free rates. |
format |
One of the output format ("data.frame" is currently the only option). |
A list of class "eiopa_rfr", with at least the following components:
a data.frame containing the risk-free rate curves.
a data.frame containing metadata about the risk-free rate curves.
This function is used to parse data received from the API into data.frame.
parse_rfr_to_df(resp)
parse_rfr_to_df(resp)
resp |
A response from the API (status 200, type/JSON). The response should have a "data" keyword with the value of an array containing the risk free rates. |
A list of class "eiopa_rfr", with at least the following components:
a data.frame containing the risk-free rate curves.
a data.frame containing metadata about the risk-free rate curves.
Build path to the options endpoint.
PATH_GET_OPTIONS(field)
PATH_GET_OPTIONS(field)
field |
the field name for the endpoint giving the available options |
A string: the path to the options endpoint.
Build path to the RFR (risk-free rate) endpoint.
PATH_GET_RFR(type, region, params)
PATH_GET_RFR(type, region, params)
type |
one of the types available by the API (see |
region |
one of the regions available by the API (see |
params |
additional GET parameters |
A string: the path to the RFR endpoint.
Print eiopa_rfr object in a readable format
## S3 method for class 'eiopa_rfr' print(x, ...)
## S3 method for class 'eiopa_rfr' print(x, ...)
x |
a response from the API |
... |
further arguments passed to or from other methods. |
An instance of class "eiopa_rfr". It is a list with at least the following components:
a data.frame containing the risk-free rate curves.
a data.frame containing metadata about the risk-free rate curves.
## Not run: resp <- get_rfr_with_va("FR", 2019, 11) print(resp) ## End(Not run)
## Not run: resp <- get_rfr_with_va("FR", 2019, 11) print(resp) ## End(Not run)
Wrapper for GET requests
try_GET(x, ...)
try_GET(x, ...)
x |
the url to request |
... |
additional parameters passed to the GET function. |
The result of the GET request.