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
1 answer

How to read a JSON object that I created in R into sparkR

I would like to take a dataframe I've created in R, and turn that into a JSON Object, and then read that JSON object into sparkR. With my current project, I can't just pass a dataframe into SparkR, and have to do this roundabout method to get my…
seanjedi
  • 69
  • 1
  • 10
0
votes
1 answer

Converting JSON to Excel using R

I'm new to R, and I'm practicing converting JSon to R, then to CSV or Excel. I downloaded the entire Magic the Gathering card set from: https://mtgjson.com/ to practice. I used this code to get it into a "list", but I'd like it in a dataframe or…
Alex
  • 77
  • 1
  • 10
0
votes
2 answers

How do I handle the presence of `{key:value}' pairs that get imported as is when parsing a JSON file?

I have a standard Android Device Status JSON file that I am trying to read as a Pandas DF and then exporting it to an Excel file. I am pasting the first two lines of my file below : {"ageCorrectionFactor":{"d":"Age Correction…
sunitprasad1
  • 768
  • 2
  • 12
  • 28
0
votes
1 answer

HTTP error 400 using Google Maps API

I am using the Google Places API to collect information about businesses. It has been working for more than 2000 queries but it has stopped now with the error Error in open.connection(con, "rb") : HTTP error 400. Code:…
user3507584
  • 3,246
  • 5
  • 42
  • 66
0
votes
0 answers

Not pulling full JSON from Open Data?

I'm looking to pull data from open data. https://data.cityofnewyork.us/Transportation/For-Hire-Vehicles-FHV-Active-and-Inactive-Vehicles/8wbx-tsch But I noticed, my code is producing only 1000 rows of data when I now there are more. Where am I going…
LoF10
  • 1,907
  • 1
  • 23
  • 64
0
votes
1 answer

Extract data from json with lapply

I have a long json file from which I want to extract the city name and its corresponding elevation. Result should be a list where column A holds the city name, column B the elevation. Here some data for R: l <- fromJSON('[{"_id":…
GeoEki
  • 437
  • 1
  • 7
  • 20
0
votes
0 answers

R - JSON Returned from RCurl::getURL has Special Characters that make it invalid with fromJSON

How can make sure that the result of my getURL() call is properly formatted to be parsed using from JSON? Details If I take the string for api URL and paste that into Chrome, then copy and paste out the resulting JSON, RJSONIO::fromJSON() will…
0
votes
2 answers

Importing JSON data in R to be saved as dataframe

I am trying to import JSON data from a URL and save it as a dataframe. Once I have it in a single rows/columns format dataframe, I want to perform cleaning operations like removing some values and columns. I am using jsonlite package to…
Fenil Dedhia
  • 365
  • 2
  • 21
0
votes
1 answer

Convert R data.frame to multilevel JSON

I have a periodic process in R that yields me a data.frame. I want to use this data.frame to create a dropdown selector with AngularJS. My final data.frame will look more or less as follows (my real example might have a deeper hierarchical…
Jon Nagra
  • 1,538
  • 1
  • 16
  • 36
0
votes
1 answer

Uninstall RJSONIO in R

How to uninstall RJSONIO package form R.. What I tried > remove.packages("RJSONIO") Removing package from ‘/Users/akshit/Library/R/3.2/library’ (as ‘lib’ is unspecified) Error in remove.packages : there is no package called ‘RJSONIO’ But if I check…
Akshit
  • 349
  • 1
  • 3
  • 10
0
votes
0 answers

how to load the first n rows of a (large) JSON file in R?

I have a very large Json file that I would like to explore in R. The most natural way to do so would be to load into the workspace only a small part of the total json data, for instance the first 100 rows. Unfortunately, I cannot find any option…
ℕʘʘḆḽḘ
  • 18,566
  • 34
  • 128
  • 235
0
votes
2 answers

R 3.2.2: "rjson" and "RJSONIO" package installed, but error using "fromJSON"

I've been having a lot of trouble using the "fromJSON" command. I'm trying to collect instagram data using their API, and this command isn't working. I'm using R and I have both packages for converting JSON to R installed, but I keep getting the…
DrumNTech
  • 1
  • 1
  • 1
0
votes
1 answer

R: how to throw an exception when an API link is not valid?

I'm using R to obtain json files from a website. In particular, I'm using the fromJSON function of the RJSONIO package. I'm trying to get json files from 50,000 website links. However, some of them might not be valid API links. Right now, I'm…
Ana
  • 15
  • 3
0
votes
0 answers

Warning message: In curlOptions: Duplicated curl options

I am working on an R script that will fetch posts from twitter. I've noticed that everytime I run below statements: l_get <- GET( l_twitterQuery, config(httpheader = c("Authorization" = l_token))) l_post <- POST( url = l_oAuthUrl …
Andres Alvarado
  • 196
  • 1
  • 11
0
votes
1 answer

Create a list in a specific format? [ Or: Create a JSON file with specific format]

I am trying to create a JSON file with a specific format. My original approach was to reverse engineer the process by reading in a source JSON file using JSONIO, examining the resulting R list element and trying to recreate that list element with my…
Tim
  • 929
  • 12
  • 30