Hi Michael
> The actual result I want is two data frames, wheat and monarch, whereas
> fromJSON returns a list of lists. I'll try to
> figure that part out.
do.call(rbind, data[[1]])
will do the job, but there are elements in each of data[[1]] and data[[2]]
that are incomplete and which need
On 12/1/2012 4:08 PM, Duncan Temple Lang wrote:
Hi Michael
The problem is that the content of the .js file is not JSON,
but actual JavaScript code.
You could use something like the following
tt = readLines("http://mbostock.github.com/protovis/ex/wheat.js";)
txt = c("[", gsub(";", ",", gsub
Hi Michael
The problem is that the content of the .js file is not JSON,
but actual JavaScript code.
You could use something like the following
tt = readLines("http://mbostock.github.com/protovis/ex/wheat.js";)
txt = c("[", gsub(";", ",", gsub("var [a-zA-Z]+ = ", "", tt)), "]")
tmp = paste(tx
I'm trying to read two data sets in json format from a single .js file.
I've tried fromJSON()
in both RJSONIOIO and RJSON packages, but they require that the lines be
pre-parsed somehow in ways I don't understand. Can someone help?
> wheat <- readLines("http://mbostock.github.com/protovis/ex/wh
4 matches
Mail list logo