我在使用rjson
包将 JSON 转换为 R 时遇到问题data.frame
。
我开始:
library("rjson")
json_file <- "btcusd.txt"
json_data <- fromJSON(paste(readLines(json_file), collapse=""))
btcusd.txt
文件包含以下内容:
{"Response":"Success","Type":100,"Aggregated":true,"Data":
[{"time":1510650000,"close":6488.28,"high":6618.69,"low":6482.22,"open":6492.35,"volumefrom":9422.44,"volumeto":61626698.63},
{"time":1510671600,"close":6541,"high":6592.05,"low":6487.35,"open":6549.1,"volumefrom":12618.61,"volumeto":82634018.7},],
"TimeTo":1511298000,"TimeFrom":1510574400,"FirstValueInArray":true,"ConversionType":{"type":"direct","conversionSymbol":""}}
谁能帮我把它变成一个data.frame?