Learn R Programming

cryptoTax (version 0.0.5)

prepare_list_prices: Prepare the list of coins for prices

Description

Prepare the list of coins for prices.

Usage

prepare_list_prices(
  coins,
  start.date,
  end.date = lubridate::now("UTC"),
  force = FALSE
)

Value

A data frame, with the following columns: timestamp, id, slug, name, symbol, ref_cur, open, high, low, close, volume, market_cap, time_open, time_close, time_high, time_low, spot.rate2, currency, date2.

Arguments

coins

Which coins to include in the list.

start.date

What date to start reporting prices for.

end.date

What date to end reporting prices for.

force

Whether to force recreating list.prices even though it already exists (e.g., if you added new coins or new dates).

Details

The crypto2::crypto_history API is at times a bit capricious. You might need to try a few times before it process correctly and without errors.

Examples

Run this code
my.coins <- c("BTC", "ETH")
my.list.prices <- prepare_list_prices(coins = my.coins, start.date = "2023-01-01")
head(my.list.prices)

Run the code above in your browser using DataLab