Giter Site home page Giter Site logo

crypto2's People

Contributors

amrrs avatar jessevent avatar jnwarp avatar sneakers-the-rat avatar sstoeckl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crypto2's Issues

crypto_history limit needs to be set with coin_list argument set

To start with, amazing package!

Not sure if intended but when filtering on a single coin in the coin_list argument by first using the crypto_list (within the crypto_history) function) it looks like the limit needs to be set in order for the function to work properly. It gives an error when the limit argument is kept at default (NULL) and when provided it runs.

Not setting the limit argument and keeping it to NULL (Default) causes error below.

image

if (!is.null(limit)) coin_list <- coin_list[1:limit, ]

Faster queries for short amount of data?

Hi, thanks for making this package, this is really useful.
I was trying out the crypto_history function and it seems that no matter if you put a short timeline to cover (just the past 7 days for example), it fetches the whole data anyway and executes a filter at the end. Would it be possible to fetch only the data of interest instead to make for much faster queries?
Thanks!

Use data.frame over tibble

Thanks for this great package. Is there any reason for using tibble over data.frame as the data format? Tibble is as slow as data.frame but more noisey, and can cause issues when converted to data.table. Would you consider using data.frame as the data format?

Hourly Data

Love the package. Thanks for developing this. Question: Do you have plans to integrate the "hourly" interval by chance? If not, I recommend removing it from the docs.

crypto_listings - Error in open.connection(con, "rb")

This:
> crypto_listings(which="latest", limit=10, quote=TRUE, finalWait=FALSE)
Gives:

Error in open.connection(con, "rb") : 
  cannot open the connection to 'https://web-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=10&aux=market_cap_by_total_supply&convert=USD&sort=cmc_rank&sort_dir=desc&start=1'
In addition: Warning message:
In open.connection(con, "rb") :
  cannot open URL 'https://web-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?limit=10&aux=market_cap_by_total_supply&convert=USD&sort=cmc_rank&sort_dir=desc&start=1': HTTP status was '400 Bad Request'

sessionInfo()

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.6

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_1.1.2      crypto2_1.4.5.99

loaded via a namespace (and not attached):
 [1] progress_1.2.2    zoo_1.8-12        tidyselect_1.2.0  remotes_2.4.2     purrr_1.0.1       lattice_0.21-8   
 [7] vctrs_0.6.3       generics_0.1.3    miniUI_0.1.1.1    htmltools_0.5.5   usethis_2.1.6     utf8_1.2.3       
[13] rlang_1.1.1       pkgbuild_1.4.0    later_1.3.1       pillar_1.9.0      urlchecker_1.0.1  glue_1.6.2       
[19] withr_2.5.0       sessioninfo_1.2.2 plyr_1.8.8        lifecycle_1.0.3   stringr_1.5.0     devtools_2.4.5   
[25] htmlwidgets_1.6.2 memoise_2.0.1     callr_3.7.3       fastmap_1.1.1     httpuv_1.6.10     ps_1.7.5         
[31] curl_5.0.0        fansi_1.0.4       Rcpp_1.0.10       xtable_1.8-4      promises_1.2.0.1  cachem_1.0.8     
[37] desc_1.4.2        pkgload_1.3.2     jsonlite_1.8.4    mime_0.12         fs_1.6.2          hms_1.1.3        
[43] digest_0.6.31     stringi_1.7.12    processx_3.8.1    shiny_1.7.4       RJSONIO_1.3-1.8   grid_4.2.1       
[49] rprojroot_2.0.3   cli_3.6.1         tools_4.2.1       magrittr_2.0.3    tibble_3.2.1      profvis_0.3.8    
[55] tidyr_1.3.0       crayon_1.5.2      pkgconfig_2.0.3   ellipsis_0.3.2    prettyunits_1.1.1 timechange_0.2.0 
[61] lubridate_1.9.2   rstudioapi_0.14   R6_2.5.1          compiler_4.2.1   



crypto_list() error

This package has always worked for me before, but today I am getting this error when I use crypto_list():

Error: Problem with mutate() input ..1.
i ..1 = dplyr::across(7:8, as.Date).
x 'origin' must be supplied

Error in if (limit == 1) { : argument is of length zero

Hello

crypto_history() returns the above error in most cases. It is particularly frustrating when it happens after a very long download time, as nothing is saved due to the error. Is there a way around this? Thanks

> data_1 <- crypto_history(start_date = "20130101", end_date = "20130201", sleep = 1)
> Scraping historical crypto data

| [32 / 32] [=====================================================] 100% in 00:32:00 ETA: 0s
Error in if (limit == 1) { : argument is of length zero
> data_1
Error: object 'data_1' not found

Self-reported tags need to get "nested"

nest self-reported tags (the coin-info-list has more entries than the coin-list due to the self-reported tags). Current workaround:
ALLINFO %>% group_by(slug) %>% nest(self_reported_tags = c(self_reported_tags))

convert tibble to data.frame

Thanks for this great R package! I used the crypto_history function to get all historical crypto prices from CoinMarketCap and got a tibble. When I convert this tibble to a data.frame, the resulted data.frame only has 11 rows. Not sure how this issue happened.

Improvements

For the next release we implement:

  • a "single_id" switch for crypto_history (to not fail the entire download when one coin in id-list is missing)
  • a "wait" selector to reduce waiting time between/after failed download to self-selected values (is automated at 60s as previously this was the servers default "you can load new data now" method for the free-api)

Error in interval time smaller than daily

When trying to collect historical price data of e.g., BTC for time intervals smaller than daily, I run into errors.

For example:
CMC_coin_data <- crypto_history(selected_coin, finalWait=FALSE, interval="hourly")

will give this error:
In crypto_history(selected_coin, finalWait = FALSE, interval = "hourly") :
interval was not valid, using "daily". see documentation for allowed values.

However, these work just fine:
CMC_coin_data <- crypto_history(selected_coin, finalWait=FALSE, interval="daily")
CMC_coin_data <- crypto_history(selected_coin, finalWait=FALSE, interval="monthly")

Which is strange, especially since the documentation in the crypto_history.R file states the following:

#' @param interval string Interval with which to sample data, default 'daily'. Must be one of "hourly" "daily" "weekly" #' "monthly" "yearly" "1d" "2d" "3d" "7d" "14d" "15d" "30d" "60d" "90d" "365d"

Or am I missing something here? Thank you!

Is there a way to categorize coins by consensus mechanism?

Hey there,

First of all, I just wanted to say that the package is really really good and I am a very happy user!

I was wondering whether there is a way to retrieve a list of coins (and time series) based on consensus mechanism such as "proof-of-work"?

For instance, there is a list of pow coins on CMC:
https://coinmarketcap.com/view/pow/

I have also found a category identifier in the API description on CMC called "consensus_mechanism" (see attachment).

That way crypto2 package users would be able to create coin indices based on consensus mechanism as well.

Thank you very much in advance for a short reply!

Best regards,
André

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.