I would like to import json data in R. I know some discussions are already posted about this subject, but unfortunately I don't have the result I want with these codes or they have many errors with my file.
I would like to import this: https://api.stocktwits.com/api/2/streams/symbol/AAPL.json in R.
I tried to do that:
AAPLapi <- 'https://api.stocktwits.com/api/2/streams/symbol/AAPL.json'
AAPLapi <- fromJSON(AAPLapi)
AAPLapi <- lapply(AAPLapi, function(x) {
x[sapply(x, is.null)] <- NA
unlist(x)
})
table=do.call("rbind", AAPLapi)
View(table)
But it's having an error at the line table=do.call
.......
Last week I don't know why but the line worked, but I had a table very weird and it was wrong.
Could you help me please?