Title: | Wrapper for the 'Prevedere' API |
---|---|
Description: | Easy and efficient access to the API provided by 'Prevedere', an industry insights and predictive analytics company. Query and download indicators, models and workbenches built with 'Prevedere' for further analysis and reporting <https://www.prevedere.com/>. |
Authors: | Wil Davis [aut, cre] |
Maintainer: | Wil Davis <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1.9000 |
Built: | 2025-01-21 04:55:49 UTC |
Source: | https://github.com/wkdavis/prevederer |
prevederer provides an R wrapper around the Prevedere Software API. The package facilitates access to the main API components, including:
Enumeration (lists of acceptable values)
Indicator
ForecastModel
Workbench
Direct calls can also be made to the API using prevedere_fetch()
.
Maintainer: Wil Davis [email protected] (0000-0001-9780-2576)
Other contributors:
Hiram Foster [email protected] [contributor]
Ted Dickinson [email protected] [contributor]
Useful links:
Report bugs at https://github.com/wkdavis/prevederer/issues
Retrieve a list of the aggregation methods currently supported by the Prevedere API.
prevedere_aggregations(key)
prevedere_aggregations(key)
key |
A Prevedere API key. |
A character vector of aggregation methods.
Other enumeration functions: prevedere_calculations
,
prevedere_frequencies
,
prevedere_seasonalities
## Not run: key <- "1235467abcdefg" prevedere_aggregations(key) ## End(Not run)
## Not run: key <- "1235467abcdefg" prevedere_aggregations(key) ## End(Not run)
Retrieve a list of the calculations currently supported by the Prevedere API.
prevedere_calculations(key)
prevedere_calculations(key)
key |
A Prevedere API key. |
A character vector of calculations.
Other enumeration functions: prevedere_aggregations
,
prevedere_frequencies
,
prevedere_seasonalities
## Not run: key <- "1235467abcdefg" prevedere_calculations(key) ## End(Not run)
## Not run: key <- "1235467abcdefg" prevedere_calculations(key) ## End(Not run)
Calculates Pearson's r and other statistics at different offsets between an endogenous and exogenous indicator.
prevedere_correlation(key, endog_provider, endog_provider_id, exog_provider, exog_provider_id, freq = prevedere_frequencies(key), calculation = prevedere_calculations(key), raw = FALSE)
prevedere_correlation(key, endog_provider, endog_provider_id, exog_provider, exog_provider_id, freq = prevedere_frequencies(key), calculation = prevedere_calculations(key), raw = FALSE)
key |
A Prevedere API key. |
endog_provider |
Code for the data provider of the endogenous indicator, can be hexadecimal or abbreviated name. |
endog_provider_id |
Specific ProviderID for the endogenous indicator. |
exog_provider |
Code for the data provider of the exogenous indicator, can be hexadecimal or abbreviated name. |
exog_provider_id |
Specific ProviderID for the exogenous indicator. |
freq |
Frequency of indicator to retrieve. For a list of supported
frequencies, see |
calculation |
Calculation to transform the indicator. For a list of
supported calculations, see |
raw |
Logical value indicating if data should be returned in its raw form (typically nested lists) or formatted as appropriate, usually a dataframe. |
Model results and metadata, as a list.
Other indicator functions: prevedere_indicator
## Not run: k <- "1235467abcdefg" prevedere_correlation( key = k, endog_provider = "BLS", endog_provider_id = "CES3133231058", exog_provider = "FRED", exog_provider_id = "PCU332313332313", freq = "Monthly", calculation = "ThreePeriodMoving" ) ## End(Not run)
## Not run: k <- "1235467abcdefg" prevedere_correlation( key = k, endog_provider = "BLS", endog_provider_id = "CES3133231058", exog_provider = "FRED", exog_provider_id = "PCU332313332313", freq = "Monthly", calculation = "ThreePeriodMoving" ) ## End(Not run)
Send a GET request to the Prevedere API. Most users should calling this function directly and instead use the appropriate wrapper for accessing each part of the API.
prevedere_fetch(key, path, payload = NULL)
prevedere_fetch(key, path, payload = NULL)
key |
A Prevedere API key. |
path |
The path (within the API) to which the request will be sent. |
payload |
The payload for the request. This should be a named list. |
The result of the API request.
## Not run: prevedere_fetch( key = "1235467abcdefg", path = "/indicator/BLS/CES3133231058", payload = list( Frequency = "Annual", Calculation = "None", Offset = 0 ) ) k <- "1235467abcdefg" prevedere_fetch( key = k, path = "/indicator/BLS/CES3133231058", payload = list( Frequency = "Annual", Calculation = "None", Offset = 0 ) ) ## End(Not run)
## Not run: prevedere_fetch( key = "1235467abcdefg", path = "/indicator/BLS/CES3133231058", payload = list( Frequency = "Annual", Calculation = "None", Offset = 0 ) ) k <- "1235467abcdefg" prevedere_fetch( key = k, path = "/indicator/BLS/CES3133231058", payload = list( Frequency = "Annual", Calculation = "None", Offset = 0 ) ) ## End(Not run)
Returns historical fit and forecasted values of a forecast model.
prevedere_forecast(key, model_id, as_of_date = NULL, raw = FALSE)
prevedere_forecast(key, model_id, as_of_date = NULL, raw = FALSE)
key |
A Prevedere API key. |
model_id |
UUID for the forecast model. |
as_of_date |
Get the model only using data up to the specified date (YYYY-MM-DD). Used for backtesting. |
raw |
Logical value indicating if data should be returned in its raw form (typically nested lists) or formatted as appropriate, usually a dataframe. |
A dataframe of forecasted values and metadata.
Other forecast model functions: prevedere_raw_model
## Not run: k <- "1235467abcdefg" prevedere_forecast(key = k, model_id = "1b1878399833c7f38b094e54dd43d374") ## End(Not run)
## Not run: k <- "1235467abcdefg" prevedere_forecast(key = k, model_id = "1b1878399833c7f38b094e54dd43d374") ## End(Not run)
Retrieve a list of the time frequencies currently supported by the Prevedere API.
prevedere_frequencies(key)
prevedere_frequencies(key)
key |
A Prevedere API key. |
A character vector of frequencies.
Other enumeration functions: prevedere_aggregations
,
prevedere_calculations
,
prevedere_seasonalities
## Not run: key <- "1235467abcdefg" prevedere_frequencies(key) ## End(Not run)
## Not run: key <- "1235467abcdefg" prevedere_frequencies(key) ## End(Not run)
Access indicator data and metadata.
prevedere_indicator(key, provider, provider_id) prevedere_indicator_series(key, provider, provider_id, freq = prevedere_frequencies(key), calculation = prevedere_calculations(key), start_date = NULL, end_date = NULL, offset_periods = 0, raw = FALSE)
prevedere_indicator(key, provider, provider_id) prevedere_indicator_series(key, provider, provider_id, freq = prevedere_frequencies(key), calculation = prevedere_calculations(key), start_date = NULL, end_date = NULL, offset_periods = 0, raw = FALSE)
key |
A Prevedere API key. |
provider |
Code for a data provider, can be hexadecimal or abbreviated name. |
provider_id |
Specific ProviderID for the indicator. |
freq |
Frequency of indicator to retrieve. For a list of supported
frequencies, see |
calculation |
Calculation to transform the indicator. For a list of
supported calculations, see |
start_date , end_date
|
Start and end dates for the indicator. Each should be
either a date or a character string capable of being coerced to a date.
Setting a date to |
offset_periods |
Number of periods to offset. |
raw |
Logical value indicating if data should be returned in its raw form (typically nested lists) or formatted as appropriate, usually a dataframe. |
A list. prevedere_indicator returns metadata for the target indicator, while prevedere_indicator_series returns the actual data for the indicator (in addition to the metadata).
Other indicator functions: prevedere_correlation
## Not run: k <- "1235467abcdefg" ## Return indicator metadata prevedere_indicator(key = k, provider = "BLS", provider_id = "CES3133231058") ## Return indicator data prevedere_indicator_series( key = k, provider = "BLS", provider_id = "CES3133231058", freq = "Monthly", calculation = "None", start_date = "2010-01-01", offset_periods = 0 ) ## Return indicator data unformatted prevedere_indicator_series( key = k, provider = "BLS", provider_id = "CES3133231058", freq = "Monthly", calculation = "None", start_date = "2010-01-01", offset_periods = 0, raw = TRUE ) ## End(Not run)
## Not run: k <- "1235467abcdefg" ## Return indicator metadata prevedere_indicator(key = k, provider = "BLS", provider_id = "CES3133231058") ## Return indicator data prevedere_indicator_series( key = k, provider = "BLS", provider_id = "CES3133231058", freq = "Monthly", calculation = "None", start_date = "2010-01-01", offset_periods = 0 ) ## Return indicator data unformatted prevedere_indicator_series( key = k, provider = "BLS", provider_id = "CES3133231058", freq = "Monthly", calculation = "None", start_date = "2010-01-01", offset_periods = 0, raw = TRUE ) ## End(Not run)
Retrieve a list of entities whose data is available in Prevedere
prevedere_providers(key, raw = FALSE)
prevedere_providers(key, raw = FALSE)
key |
A Prevedere API key. |
raw |
Logical value indicating if data should be returned in its raw form (typically nested lists) or formatted as appropriate, usually a dataframe. |
A dataframe (or list if raw = TRUE
) of provider metadata.
## Not run: k <- "1235467abcdefg" prevedere_providers(key = k) ## End(Not run)
## Not run: k <- "1235467abcdefg" prevedere_providers(key = k) ## End(Not run)
Returns all information about a forecast model.
prevedere_raw_model(key, model_id, exclude_indicators = TRUE, as_of_date = NULL, raw = FALSE)
prevedere_raw_model(key, model_id, exclude_indicators = TRUE, as_of_date = NULL, raw = FALSE)
key |
A Prevedere API key. |
model_id |
UUID for the forecast model. |
exclude_indicators |
Whether to return only indicators used in model (TRUE), or all associated indicators. |
as_of_date |
Get the model only using data up to the specified date (YYYY-MM-DD). Used for backtesting. |
raw |
Logical value indicating if data should be returned in its raw form (typically nested lists) or formatted as appropriate, usually a dataframe. |
A list of model components and metadata, including indicators, coefficients, and the model start date.
Other forecast model functions: prevedere_forecast
## Not run: k <- "1235467abcdefg" prevedere_raw_model(key = k, model_id = "1b1878399833c7f38b094e54dd43d374") ## Backtest prevedere_raw_model(key = k, model_id = "1b1878399833c7f38b094e54dd43d374", as_of_data = "2019-05-01") ## End(Not run)
## Not run: k <- "1235467abcdefg" prevedere_raw_model(key = k, model_id = "1b1878399833c7f38b094e54dd43d374") ## Backtest prevedere_raw_model(key = k, model_id = "1b1878399833c7f38b094e54dd43d374", as_of_data = "2019-05-01") ## End(Not run)
Retrieve a list of the seasonalities currently supported by the Prevedere API.
prevedere_seasonalities(key)
prevedere_seasonalities(key)
key |
A Prevedere API key. |
A character vector of seasonalities.
Other enumeration functions: prevedere_aggregations
,
prevedere_calculations
,
prevedere_frequencies
## Not run: key <- "1235467abcdefg" prevedere_seasonalities(key) ## End(Not run)
## Not run: key <- "1235467abcdefg" prevedere_seasonalities(key) ## End(Not run)
Returns the indicators used in a workbench. Typically includes workbench metadata and associated indicator metadata.
prevedere_workbench(key, workbench_id)
prevedere_workbench(key, workbench_id)
key |
A Prevedere API key. |
workbench_id |
UUID for workbench. |
A list of workbench metadata.
## Not run: k <- "1235467abcdefg" prevedere_workbench(key = k, workbench_id = "b8da829f7a1d4509ca5125e4699d6f0e") ## End(Not run)
## Not run: k <- "1235467abcdefg" prevedere_workbench(key = k, workbench_id = "b8da829f7a1d4509ca5125e4699d6f0e") ## End(Not run)