Hello everyone,

For starters, I want to thank Dirk and Ilya for helping me.  Following
Dirk's suggestion, I'll try to describe the objective better and post a MWE
next.
The main objective is to define a data frame that has all exchanges
available along with the intervals each one of them the provide.

Sys.setenv(TZ = "America/Sao_Paulo")
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)

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]
>

        [[alternative HTML version deleted]]

_______________________________________________
[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.

Reply via email to