diff --git a/R/crypto_history.R b/R/crypto_history.R index 11e9dc8..83c3a0c 100644 --- a/R/crypto_history.R +++ b/R/crypto_history.R @@ -6,7 +6,8 @@ #' analysis on the crypto financial markets or to attempt #' to predict future market movements or trends. #' -#' @param coin string Name, symbol or slug of crypto currency, default is all tokens +#' @param coins string if NULL retrieve all currently existing coins (crypto_list()), +#' or provide list of crypto currencies in the crypto_list() format (e.g. current and dead coins since 2015) #' @param limit integer Return the top n records, default is all tokens #' @param start_date string Start date to retrieve data from, format 'yyyymmdd' #' @param end_date string End date to retrieve data from, format 'yyyymmdd' @@ -55,7 +56,7 @@ #' #' @export #' -crypto_history <- function(coin = NULL, limit = NULL, start_date = NULL, end_date = NULL, +crypto_history <- function(coins = NULL, limit = NULL, start_date = NULL, end_date = NULL, coin_list = NULL, sleep = NULL) { pink <- crayon::make_style(grDevices::rgb(0.93, 0.19, 0.65)) options(scipen = 999) @@ -70,8 +71,8 @@ crypto_history <- function(coin = NULL, limit = NULL, start_date = NULL, end_dat message("ERC-20: 0x375923Bf82F0b728d23A5704261a6e16341fd860", appendLF = TRUE) message("XRP: rK59semLsuJZEWftxBFhWuNE6uhznjz2bK", appendLF = TRUE) message("\n") - # only if no coin_list is provided - if (is.null(coin_list)) coins <- crypto_list(coin, start_date, end_date, coin_list) + # only if no coins are provided + if (is.null(coins)) coins <- crypto_list(coin, start_date, end_date, coin_list) if (!is.null(limit)) coins <- coins[1:limit, ] diff --git a/R/crypto_list.R b/R/crypto_list.R index dafb8fd..2c7384a 100644 --- a/R/crypto_list.R +++ b/R/crypto_list.R @@ -36,7 +36,7 @@ #' coin_list <- crypto_list() #' #' # return all coins listed in 2015 -#' coins_list_2015 <- crypto_list(start_date_hist="20150101",end_date_hist="20151231",date_gap="months") +#' coin_list_2015 <- crypto_list(start_date_hist="20150101",end_date_hist="20151231",date_gap="months") #' #' } #' diff --git a/man/crypto_history.Rd b/man/crypto_history.Rd index 2fe4e51..c6dcef2 100644 --- a/man/crypto_history.Rd +++ b/man/crypto_history.Rd @@ -4,11 +4,12 @@ \alias{crypto_history} \title{Get historic crypto currency market data} \usage{ -crypto_history(coin = NULL, limit = NULL, start_date = NULL, +crypto_history(coins = NULL, limit = NULL, start_date = NULL, end_date = NULL, coin_list = NULL, sleep = NULL) } \arguments{ -\item{coin}{string Name, symbol or slug of crypto currency, default is all tokens} +\item{coins}{string if NULL retrieve all currently existing coins (crypto_list()), +or provide list of crypto currencies in the crypto_list() format (e.g. current and dead coins since 2015)} \item{limit}{integer Return the top n records, default is all tokens} diff --git a/man/crypto_list.Rd b/man/crypto_list.Rd index 3aef444..74a4fed 100644 --- a/man/crypto_list.Rd +++ b/man/crypto_list.Rd @@ -28,7 +28,6 @@ Crypto currency historic OHLC market data in a dataframe: \item{symbol}{Coin symbol (not-unique)} \item{name}{Coin name} \item{slug}{Coin URL slug (unique)} - \item{rank}{Current rank by market cap} \item{exchange_url}{Exchange market tables urls for scraping} \item{history_url}{Historical market tables urls for scraping} @@ -50,7 +49,7 @@ coins <- crypto_list(coin) coin_list <- crypto_list() # return all coins listed in 2015 -coins_list_2015 <- crypto_list(start_date_hist="20150101",end_date_hist="20151231",date_gap="months") +coin_list_2015 <- crypto_list(start_date_hist="20150101",end_date_hist="20151231",date_gap="months") }