Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将此API调用转换为r中的数据表?_R_Api_Datatable_Finance_Elixir Iex - Fatal编程技术网

如何将此API调用转换为r中的数据表?

如何将此API调用转换为r中的数据表?,r,api,datatable,finance,elixir-iex,R,Api,Datatable,Finance,Elixir Iex,我想将IEX的呼叫转换为R中的数据表: 谢谢,您可以使用rjson包的fromJSON,然后将列表转换为数据.frame。请参阅下面的代码: library(rjson) f <- (fromJSON(file = "https://api.iextrading.com/1.0/ref-data/symbols")) df <- data.frame(t(sapply(f, unlist)), stringsAsFactors = FALSE) str(df) 你试过什么吗?你被

我想将IEX的呼叫转换为R中的数据表:


谢谢,

您可以使用
rjson
包的
fromJSON
,然后将
列表
转换为
数据.frame
。请参阅下面的代码:

library(rjson)
f <- (fromJSON(file = "https://api.iextrading.com/1.0/ref-data/symbols"))
df <- data.frame(t(sapply(f, unlist)), stringsAsFactors = FALSE)
str(df)

你试过什么吗?你被卡在哪里了?不如干脆
jsonlite::fromJSON(“https://api.iextrading.com/1.0/ref-data/symbols“”
API新手,不知道从哪里开始!感谢您的领先。GitHub上的解决方案:
'data.frame':   8691 obs. of  6 variables:
 $ symbol   : chr  "A" "AA" "AAAU" "AABA" ...
 $ name     : chr  "Agilent Technologies Inc." "Alcoa Corporation" "Perth Mint Physical Gold" "Altaba Inc." ...
 $ date     : chr  "2018-09-19" "2018-09-19" "2018-09-19" "2018-09-19" ...
 $ isEnabled: chr  "TRUE" "TRUE" "TRUE" "TRUE" ...
 $ type     : chr  "cs" "cs" "N/A" "cs" ...
 $ iexId    : chr  "2" "12042" "14924" "7653" ...