Questions tagged [rjsonio]

RJSONIO is an R package that allows conversion to and from data in Javascript object notation (JSON) format. This allows R objects to be inserted into Javascript/ActionScript code and allows R programmers to read and convert JSON content to R objects.

RJSONIO is an package that allows conversion to and from data in Javascript object notation () format. This allows R objects to be inserted into / code and allows R programmers to read and convert JSON content to R objects. It is an alternative to the rjson package. The RJSONIO package uses methods, vectorized operations and code and callbacks to R functions for deserializing JSON objects to R. It allows fast parsing of large JSON documents.

The primary functions in the package are

  • fromJSON
  • toJSON
  • asJSVars

The package is extensible, allowing others to define S4 methods for toJSON for different R classes/types. Similarly, the fromJSON function allows the caller to specify a different callback handler which is invoked each time an element (e.g. number, string, key, start or end of an array or object) is found in the JSON content.

Repositories

Other resources

Related tags

83 questions
0
votes
2 answers

How to append data through for loops

I am trying to recursively collect data through loops. I wrote this command and it works for collecting information from 2 pages. For example, library(jsonlite) data1 <- fromJSON("https://www.example.com/?page=1", flatten = TRUE) data2 <-…
user3570187
  • 1,743
  • 3
  • 17
  • 34
0
votes
1 answer

How can I match JSON format requirement in R when using RJSONIO to convert my data structure to JSON data

I have this data structure that I want to convert to JSON via the RJSONIO::toJSON call tmpdf<-data.frame(Date=c("20140610", "20140611"), Users=c(5,10)) tmp<-list(data=tmpdf, onduplicate=data.frame(Users="replace"), …
Dr. Mike
  • 2,451
  • 4
  • 24
  • 36
0
votes
1 answer

How do I pull .js or .json data from a specific URL into an R data frame

I have been trying to pull data from this specific URL: http://leafletjs.com/examples/us-states.js using RJSONIO. I went to that URL and saved the data by pressing CTRL+A to select all of the data there and then pasted it into notepad++, saving it…
Jonathan Charlton
  • 1,975
  • 6
  • 23
  • 30
0
votes
1 answer

add multiple polygons to rCharts leaflet map

When I try to add more than one polygon to a leaflet map with rCharts using the map$geoJson() function, only the last polygon appears on the map. The other ones are not displayed. Any idea on what I can do to add more than one polygon to my map?…
maRtin
  • 6,336
  • 11
  • 43
  • 66
0
votes
1 answer

Extracting population data from website; wiki town webpages

G'day Everyone, I am looking for a raster layer for human population/habitation in Australia. I have tried finding some free datasets online but couldn't really find anything in a useful formate. I thought it might be interesting to try and scrape…
Adam
  • 1,147
  • 3
  • 15
  • 23
0
votes
1 answer

opencpu returns numbers with max 5 digits

I noticed that if I return my R results that numbers are limited to 5 digits, e.g. 100.34 while R is giving me 100.344523. Is it possible to increase this? I found that you can set the amount of digits in toJSON, but how to do that with…
ricoderks
  • 1,619
  • 9
  • 13
0
votes
1 answer

Strange behaviour in fromJSON in RJSONIO package

Ok, I'm trying to convert the following JSON data into an R data frame. For some reason fromJSON in the RJSONIO package only reads up to about character 380 and then it stops converting the JSON properly. Here is the…
Simon Hayward
  • 694
  • 11
  • 26
0
votes
1 answer

How to install R packages that use header files (RJSONIO, Rcpp)?

I'm unable to install several R packages because they always fail on the first include statement. This is the error I get for Rcpp: install.packages("/Users/nacho/Downloads/Rcpp_0.10.3.tar.gz", repos=NULL, type="source") Installing package(s) into…
nachocab
  • 13,328
  • 21
  • 91
  • 149
1 2 3 4 5
6