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
1
vote
0 answers

combining JSON pages with RJSONIO

I am having a problem with combining multiple pages with RJSONIO. Base version: If I try with one page, it works: test11<-RJSONIO::fromJSON("http://zoeken.kvk.nl/Address.ashx?site=handelsregister&q=01000040") df<-ldply(test11, data.frame) However,…
RobertHaa
  • 79
  • 2
  • 10
1
vote
0 answers

Invalid characters with fromJSON function

I am trying to import json file into R. For the purpose I am using packages such as rjson, jsonlite, RJSONIO, etc. I have tried different things as shown below but I got errors with all of them. mydata <-…
Datmach
  • 41
  • 1
  • 2
1
vote
1 answer

rbind.pages with missing pages "Error: all(vapply(pages, is.data.frame, logical(1)))" is not TRUE

I am trying to rbind.pages with jsonlite from web where some of the data files are missing(for example values for aa are missing). temp<- c("6702","1","67") library(jsonlite) baseurl <- "https://api.angel.co/1/startups/" pages <- list() for(i in…
user3570187
  • 1,743
  • 3
  • 17
  • 34
1
vote
1 answer

Chaining multiple replacement functions in R

I am using R to work with a large JS object (using the library rjsonio). As such, I have a lot of nested lists, which are getting somewhat cumbersome to work with. I have a simplified example below. I am trying to work with this object by…
mgcdanny
  • 1,082
  • 1
  • 13
  • 20
1
vote
0 answers

R - JSON with strings and integers

How do I override that all items in JSON are converted to string? When I run require("RJSONIO") toJSON(structure(c("nonce", as.integer(5487)), names = c("nonce", "price"), class = c("character", "integer"))) I would expect this "{\n \"nonce\":…
Steef Gregor
  • 544
  • 1
  • 7
  • 21
1
vote
1 answer

How to pass a variable in url in fromJSON command

I am trying to pass a variable in the url and flatten using jsonlite, but i am not able to pass variable pages using the loop. How do i loop using FromJSON? pages<- list() for(i in 1:20) { mydata <-…
user3570187
  • 1,743
  • 3
  • 17
  • 34
1
vote
1 answer

Extract data from json format in R

I have a json format time series data and I would like to extract the data from json format and convert it to data frame in R. I have installed rjson and jsonlite packages and loaded the library. However, I encountered the following error when I ran…
r_beginner
  • 11
  • 3
1
vote
1 answer

Dataframe in R to be converted to sequence of JSON objects

I had asked the same question after editing 2 times of a previous question I had posted. I am sorry for the bad usage of this website. I have flagged it for deletion and I am posting a proper new question on the same here. Please look into this. I…
user2878729
  • 61
  • 1
  • 5
1
vote
2 answers

R error - subscript out of bounds

I am trying to run this code which takes a list of addresses and runs each one through Google's Geocode API (using function Addr2latlng below) to get the latitude/longitude and puts each one into a data frame using ProcessAddrList below. The problem…
user3055574
  • 11
  • 1
  • 4
1
vote
1 answer

how to create a JSON object that contains a date format

I have a named list in R that I want to convert to JSON (in order to send it as a document in MongoDB) L=list(A=1,B=as.POSIXct("1990-01-01")) If I do simply toJSON, the date format of the second element is lost (it is converted to numeric). >…
RockScience
  • 17,932
  • 26
  • 89
  • 125
1
vote
1 answer

Using JSON schema as column headers in dataframe

Ok, as per a previous question (here) I've now managed to read a load of JSON data into R and to get the data into a data frame. here's the code:- getCall <- GET("http://long-url.com", authenticate("myusername",…
Simon Hayward
  • 694
  • 11
  • 26
1
vote
2 answers

Import JSON data with multiple lines and convert to data frame in R

Suppose I have the following JSON data: { "_id" : { "$oid" : "string" }, "titulo" : "string", "id_cv" : 1132, "textos" : [ { "fecha" : { "$date" : 1217376000000 }, "estado" : "string", "texto" : "string", "source_url" : "string" } ] } { "_id" : {…
DV Hughes
  • 305
  • 2
  • 5
  • 22
1
vote
2 answers

Parsing Facebook JSON results in R

I already read other questions but I still don't know how to parse Facebook Graph Search results in R. My main goal is to convert in something like a data frame, to analyze some columns. library(RCurl) library(RJSONIO) library(rjson) data <-…
1
vote
1 answer

RJSONIO connection issue

This question can be hard to answer but maybe you can guide me about debuging such issue. I wrote few scripts, many functions, one above the other. I develop in recent version of RStudio (with recent R installed). I finished my first beta of script…
jangorecki
  • 16,384
  • 4
  • 79
  • 160
1
vote
1 answer

Problems extracting variables from a JSON http-source with RJSONIO

I am trying to retrieve the longitude and latitude of a city. I have created a script that uses JSON via the openstreetmap.org. library("RJSONIO") CityName <- "Rotterdam" CountryCode <- "NL" CityName <- gsub(' ','%20',CityName) url <- paste( …
Jochem
  • 3,295
  • 4
  • 30
  • 55