我尝试使用dplyr库将okex-ticker转换为数据帧,这在其他市场上非常成功。
这是整个代码:
library(dplyr)
library(httr)
GET(
url = "https://www.okex.com/v2/spot/markets/tickers"
) -> okexRes
x5=content(okexRes)
dfokex <- bind_rows(x5$data)
我认为最后一行的括号中缺少一些内容,例如(x5$data$???)
,但是在RStudio的环境中,看起来像这样
x5 Large list
code : int 0
data :List of 407
..$ :List of 24
.. .. $ brokerId: int 0
.. .. $ buy: chr "9314.4"
.. .. $ change: ...
这里第二个列表的名称是什么?有显示名称的功能吗? 在此先感谢:)