Hi all,
how can I store data received from websocket API? We all know how to print it to console:
ws$onMessage(function(event) {
cat("Client got msg:", event$data, "\n")
})
But what I would like to do is something like:
ws$onMessage(function(event) {
result <- as.data.frame(fromJSON(event$data))
})
I know my connection works okay and when I write the result as csv inside the onMessage function, it works but the result object does not show in the environment.
What can be done to actually get the data frame from the call in the global environment?