Questions tagged [rjson]

Converts R object into JSON objects and vice-versa

rjson is an package for woking with , allowing JSON objects to be imported as R objects, and R objects to be serialized as JSON.

Repositories

Vignettes

Other resources

Related tags

135 questions
2
votes
0 answers

Ability to JSON serialize and deserialize int64 with precision in R

In R, Int64 whole numbers can not be accurately serialized to and from JSON, because existing JSON libraries will coerce the value into a numeric, or expect to represent the number in scientific notation. Does anyone know of a way to accurately…
Val H
  • 507
  • 4
  • 13
2
votes
3 answers

Converting a matrix/dataframe in R to JSON object with some constraints

REDITED: I have to convert a matrix in R to a JSON object with some structure in it. I am using the rjson package. Through an example, let me illustrate what I want. My specific case is the output of a recommender system code in R where the X2 X3…
user2878729
  • 61
  • 1
  • 5
2
votes
1 answer

Geocoding with R and Googlemaps API

I use R regularly for statistical analysis but am slowly trying to move to GIS and Spatial visualization with R. I am trying replicate the geocoding code available at…
vinod
  • 87
  • 1
  • 3
  • 7
2
votes
1 answer

fromJSON only reads first line in R

I've got a sample JSON file with about 500 tweets which I'd like to get into a dataframe. The first three tweets from the JSON file are as follows (urls have been changed deliberately to fit within stackoverflow rules on…
2
votes
1 answer

R: Extract JSON Variable Info

I'm trying to download NBA player information from Numberfire and then put that information into a data frame. However I seem to be running into a few issues The following snippet downloads the information just…
rwdvc
  • 455
  • 5
  • 13
2
votes
1 answer

How to send multiple documents using RMongo

I am following the conventions from http://docs.mongodb.org/manual/reference/method/db.collection.insert/ to send a batch of multiple documents in one call of RMongo::dbInsertDocument. data=data.frame(A=c(1,2),B=c(3,4)) …
RockScience
  • 17,932
  • 26
  • 89
  • 125
2
votes
1 answer

Convert data frame to JSON in this format

I have a data frame that I'm looking to output to JSON in a particular format, with a small sample below: dat <- structure(list(unit = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L), .Label = c("A", "B"), class = "factor"), type = structure(c(1L, …
Tommy O'Dell
  • 7,019
  • 13
  • 56
  • 69
2
votes
1 answer

json format to csv format conversion, special case

I have a json file whose rows are in the format as follows: {"checkin_info": {"11-3": 17, "8-5": 1, "15-0": 2, "15-3": 2, "15-5": 2, "14-4": 1, "14- 5": 3, "14-6": 6, "14-0": 2, "14-1": 2, "14-3": 2, "0-5": 1, "1-6": 1, "11-5": 3, "11-4": 11,…
Ayush Raj Singh
  • 863
  • 5
  • 16
  • 20
2
votes
0 answers

How to parse JSON in R if not from a URL

I am trying to convert/parse a JSON string in R, but am having trouble. I have installed both rjson and RJSONIO packages. library(rjson) install.packages("rjson") require(rjson) Example row of a dataset: dataset <- data.frame(id = c(1), signup_get…
user1489719
  • 119
  • 1
  • 6
  • 12
2
votes
1 answer

How to stream and save Facebook public posts with R?

I'm trying to stream and save public posts through R. I already got the token and made the search. This is what i've done. require(RCurl) require(rjson) data <-…
1
vote
1 answer

Convert a list to a dataframe

I read the data from a json file using this option library("rjson") result <- fromJSON(file = "input.json") And the result is a list. I would like to convert this list into a dataframe with colum names. However, the list has many nested options.…
Erik Brole
  • 315
  • 9
1
vote
0 answers

parse_stream doesnt seem to convert my json file to a data frame. The result it gives me is null

I am tryin to use parse_stream to convert a json file to a data frame, it doesnt create the data frame instead it shows up under values in r-studio and it is null. library(rtweet) library(rjson) stream_tweets(q='brasil, brazil',timeout =…
lams
  • 352
  • 1
  • 10
1
vote
2 answers

Best way to convert a list into a JSON

I have a script that looks something like this (though not exactly because I obviously can't give my API key and what not to make it fully…
user16497487
1
vote
1 answer

jqr package not matching results from jq

person <- GET( "https://api.secure.com/v4/people/111322450?$expand=customFields", accept_json(), add_headers(Accept = 'application/json', Authorization = APIKey) ) capture <- content(person) dput(capture) capture <- list(vanId =…
wizkids121
  • 634
  • 1
  • 9
  • 22
1
vote
1 answer

merge multiple table with different length and form a single table in R

i am using plumber api for an api. i have multiple sub-tables in which all table are connected with there primary keys (study_id) and i wanted to merge all table with single primary keys to form a single table. Some tables have different length. for…
1 2
3
8 9