On 8 February 2026 at 08:33, Andre Luiz Tietbohl Ramos wrote:
| library(lubridate)
| library(dplyr)
| library(svDialogs)
| library(stringr)
| library(tidyverse)
| library(rvest)
| library(RCurl)
| library(reprex)
| library(tibble)
| library(quantmod)
|
| library(cryptoQuotes)
| library(crypto2)
| library(cryptotrackr)
| library(coinmarketcapr)
So after I explain what a MCVE example is, and let's stress minimal here, you
post a snippet requiring 14 packages? And likely API keys? Interesting choice.
And if I may, sending 40% of the list traffic here
> tb <- table(readLines(pipe("grep 'From: ' r-sig-finance | tail -50")))
> tail(tb[order(tb)],1)
From: Andre Luiz Tietbohl Ramos <[email protected]>
20
>
may not get you where you want to go. I cannot speak for everybody here but I
think most are happy to 'help you learn to help yourself', but I don't you
can expect us to be your assistants doing custom programming for you.
For this question Ilya already explained to you how to peek into a nested
list. I would start there.
Dirk
|
| exchanges.names <- c('binance', 'bitmart', 'bybit', 'crypto.com', 'huobi',
| 'kraken', 'kucoin', 'mexc')
| intervals <- list(list('1s', '1m', '3m', '5m', '15m', '30m', '1h', '2h',
| '4h', '6h', '8h', '12h', '1d', '3d', '1w', '1M'),
| list('1m', '3m', '5m', '15m', '30m', '1h', '2h',
| '4h', '6h', '12h', '1d', '3d', '1w'),
| list('1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h',
| '6h', '12h', '1d', '1M', '1w'),
| list('1m', '5m', '15m', '30m', '1h', '2h', '4h', '12h',
| '1d', '1w', '2w', '1M'),
| list('1m', '5m', '15m', '30m', '1h', '4h', '1d', '1w',
| '1M'),
| list('1m', '5m', '15m', '30m', '1h', '4h', '12h', '1d',
| '1w'),
| list('1m', '5m', '15m', '30m', '1h', '2h', '4h', '8h',
| '12h', '1d', '1w'),
| list('1m', '5m', '15m', '30m', '1h', '4h', '8h', '1d',
| '1w', '1M') )
| exchanges.intervals <- as.data.frame(cbind(exchanges.names, intervals))
|
| ## filtering for the binance exchange, for example:
| selected <- exchanges.intervals[exchanges.names == "binance", ]
|
| This data is below,
|
| > exchanges.names
| [1] "binance" "bitmart" "bybit" "crypto.com" "huobi"
| "kraken" "kucoin" "mexc"
| > intervals
| [[1]]
| [[1]][[1]]
| [1] "1s"
| ...
| [[8]]
| [[8]][[1]]
| [1] "1m"
| ...
| [[8]][[10]]
| [1] "1M"
|
| > exchanges.intervals
| exchanges.names
| intervals
| 1 binance 1s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d,
| 3d, 1w, 1M
| 2 bitmart 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h,
| 1d, 3d, 1w
| 3 bybit 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h,
| 1d, 1M, 1w
| 4 crypto.com 1m, 5m, 15m, 30m, 1h, 2h, 4h, 12h, 1d,
| 1w, 2w, 1M
| 5 huobi 1m, 5m, 15m, 30m, 1h, 4h,
| 1d, 1w, 1M
| 6 kraken 1m, 5m, 15m, 30m, 1h, 4h,
| 12h, 1d, 1w
| 7 kucoin 1m, 5m, 15m, 30m, 1h, 2h, 4h, 8h,
| 12h, 1d, 1w
| 8 mexc 1m, 5m, 15m, 30m, 1h, 4h, 8h,
| 1d, 1w, 1M
| >
|
| > exchanges.intervals[[2]][[1]]
| [[1]]
| [1] "1s"
| ...
| [[4]]
| [1] "5m"
| ...
| [[16]]
| [1] "1M"
| >
|
| > exchanges.intervals[exchanges.names == "binance", ]
| exchanges.names
| intervals
| 1 binance 1s, 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h,
| 12h, 1d, 3d, 1w, 1M
|
| Assume I want the fourth interval from the binance exchange, which is 5
| minutes or 5m.
| How can I filter or select this data and assign it to a variable, please?
| Of course it is quite easy to assign it result to a variable but I don't
| know its first part.
| I hope what I detailed above will help you.
|
| --
| André Luiz Tietbohl Ramos, PhD
|
|
| On Sat, Feb 7, 2026 at 2:52 PM Dirk Eddelbuettel <[email protected]> wrote:
|
| >
| > Andre,
| >
| > You may find that may you get better answers if you "improve" your
| > questions.
| > One writeup on how to craft good 'minimally verifiable complete examples'
| > (aka MVCE) ones is
| >
| >
| >
https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
| >
| > which you may want to read (fully). A helpful command is `dput` as it
| > allows
| > you send (minimal, toy, still representative) data set along with it.
| >
| > C
| >
| > --
| > dirk.eddelbuettel.com | @eddelbuettel | [email protected]
| >
--
dirk.eddelbuettel.com | @eddelbuettel | [email protected]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should
go.