Skip to contents

A history with missing days (see has_gaps()) is returned but not kept, so the next call downloads it again.

Usage

keep_history(key, history, from)

Arguments

key

Key of the coin in disk_cache().

history

Price history of the coin, or NULL when the download failed.

from

Date. The first day asked for, which can be earlier than the first day of the coin.

Value

A list with the history, from and the time of the download, or NULL when history is NULL.

Examples

if (FALSE) { # \dontrun{
coins <- get_coins()
btc <- coins[coins$name_symbol == "Bitcoin (BTC)", ]
crypto:::keep_history("history_1", crypto:::download_history(btc, Sys.Date() - 30), Sys.Date() - 30)
} # }