I found a great package on GitHub to do a time series analysis for my master thesis: GitHub - sstoeckl/crypto2: Cryptocurrency Market Data. I want to aquire all crypto data from coinmarketcap, which are older than 2018.
library(crypto2)
library(data.table)
library(tidyverse)
library(dplyr)
List all active coins that are older than 2018
coins <- as.data.table(crypto_list(only_active=TRUE))
coins <- coins[first_historical_data < "2018-01-01"]
coin_info <- crypto_info(coins,limit=3)
retrieve historical data for all of them
coin_hist <- crypto_history(coins, convert = "USD")
Unfortunately, I can't load the data through the API and always get the error: "Error in if (limit == 1) { : argument is of length zero", after the coin_hist command.
Normally the next step should be, to write the csv.file.
write.csv(coin_hist, "crypto_data.csv")
coin_hist <- read.csv("crypto_data.csv")
coin_hist$X <- NULL
The download includes 187 observations and takes approx. 3 hours - I tried it several times on multiple devices and I am a bit at a loss. Also I am bloody new to R and would highly appreaciate any advice =)