Skip to contents

Adapt a CSV of precomputed indicators

Usage

ledgr_adapter_csv(
  csv_path,
  value_col,
  date_col = "ts_utc",
  instrument_col = "instrument_id",
  id
)

Arguments

csv_path

Path to CSV file with indicator values.

value_col

Column name containing indicator values.

date_col

Column name containing timestamps (default "ts_utc").

instrument_col

Column name containing instruments (default "instrument_id").

id

Indicator identifier.

Value

A ledgr_indicator object.

Examples

csv_path <- tempfile(fileext = ".csv")
utils::write.csv(data.frame(
  ts_utc = c("2020-01-01T00:00:00Z", "2020-01-02T00:00:00Z"),
  instrument_id = "AAA",
  my_value = c(1.5, 2.5)
), csv_path, row.names = FALSE)
ind <- ledgr_adapter_csv(csv_path, value_col = "my_value", id = "my_csv_value")
ind$id
#> [1] "my_csv_value"