prevedere_indicator: Indicators

Description Usage Arguments Value See Also Examples

View source: R/indicator.R

Description

Access indicator data and metadata.

Usage

1
2
3
4
5
6
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)

Arguments

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 prevedere_frequencies().

calculation

Calculation to transform the indicator. For a list of supported calculations, see prevedere_calculations().

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 NULL will result in the historical data being unbounded in that direction.

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.

Value

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).

See Also

Other indicator functions: prevedere_correlation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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)

prevederer documentation built on July 23, 2019, 5:05 p.m.