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

Convert json file to R object in R

I am trying to convert a json file in R. The format of the data is as follows: { "id": "xyz", "root": { "author": { "name": "xyz", "email": "xyx@xyz.org", "date": "2014-10-08T00:10:30Z" }, "authorer": { "name": "xyz", "email":…
user3570187
  • 1,743
  • 3
  • 17
  • 34
0
votes
2 answers

Calculate sum of counts per min from data frame in R

I've been trying to figure this out for a while, but haven't been able to do so. I found a lot of similar questions which didn't help at all. I have around 43000 records in data frame in R. The date column is in the format "2011-11-15 02:00:01",…
user1828605
  • 1,723
  • 1
  • 24
  • 63
0
votes
1 answer

how do you create a custom json output from an R function with dataframe and column names as arguments

I need to create and R function that would take a data frame and column names as arguments (there should be at least two column names in the argument list and maybe more). Then given the data frame, I need to create a json formatted output based the…
user1471980
  • 10,127
  • 48
  • 136
  • 235
0
votes
1 answer

Filling in missing values from API imported data

I'm using API to get data from the Census Bureau. The good news is that I'm able to retrieve the data. The bad news is that I can't get it into a format that is usable for analysis and mapping. My question: Is there a way to modify the API call or…
Nancy
  • 3,989
  • 5
  • 31
  • 49
0
votes
1 answer

How to send RJSON request using jquery

I have found lot of articles showing solutions to compress JSON string but none seem to explain the procedure for sending this compressed JSON string as a request via JQuery. The article at https://github.com/dogada/RJSON shows one of the ways to…
0
votes
2 answers

how to convert data frame to json format in R

I have a data frame like this: dput(y) structure(list(Name = c("Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon", "Logon"),…
user1471980
  • 10,127
  • 48
  • 136
  • 235
0
votes
1 answer

Python simplejson quoting for R rjson input

I'm processing data within Python, and would like to stream records to R using JSON formatting and simplejson on the Python side, and rjson on the R side. How can I output records out of Python so that R's fromJSON can process them into a one-line…
user2105469
  • 1,413
  • 3
  • 20
  • 37
-1
votes
1 answer

Using RCurl with multiple quotes and parentheses

I am trying to get this API (that works in shell) to work within R: curl -H 'Content-Type: text/json' -d '{"Symbols":["FLDB","APOE"]}' https://toppgene.cchmc.org/API/lookup I followed this example and wrote this R…
user2167741
  • 277
  • 1
  • 10
-1
votes
1 answer

Can anyone help me on extracting data using Json file of Yelp to the R?

https://www.yelp.com/dataset/documentation/main There are some examples for the Python. But none using the rjson package. I'm Confused and have no idea on how to establish a connection and get the data in the form of csv. I really appreciate if…
-1
votes
1 answer

specify the path to the common folder with json files in R

to parse json, i can use this approach library("rjson") json_file <- "https://api.coindesk.com/v1/bpi/currentprice/USD.json" json_data <- fromJSON(paste(readLines(json_file), collapse="")) but what if i want work with set of json files it…
psysky
  • 3,037
  • 5
  • 28
  • 64
-1
votes
1 answer

How to read multi-level JSON files?

I have a multi-level JSON file like so: { "key1":1, "key2":"a" } { "key1":2, "key2":"b" } My goal is to convert this file into a data frame with two columns and two rows like so: ml_df key1 key2 1 1 a 2 2 b At the moment, I…
Joe
  • 1,628
  • 3
  • 25
  • 39
-1
votes
1 answer

Significant digits when converting to JSON

I have a matrix mat of lat/lon coordinates that are accurate to the 12th decimal place. My objective is transform the matrix into a JSON that keeps those digits intact. > head(mat) [,1] [,2] [1,] -122.6790 45.51459 [2,] -122.6789…
iskandarblue
  • 7,208
  • 15
  • 60
  • 130
-1
votes
1 answer

I need to convert data frame into json format in R

I have this data frame: dput(head(dat)) structure(list(out = c(5, 0, 0, 0, 0, 0), Date = c(1423825200000, 1423825500000, 1423825800000, 1423826100000, 1423826400000, 1423826700000 )), .Names = c("out", "Date"), row.names = c(NA, 6L), class =…
user1471980
  • 10,127
  • 48
  • 136
  • 235
-1
votes
1 answer

Nested JSON data to CSV

I am trying to convert JSON from a URL to CSV/data.frame in R. The data is at: Data_Kayak and pasted below. So far, I have tried the newJSONParser() and fromJSON from library(rjson). I got close enough to generating a list but that is the best I've…
gallivant
  • 41
  • 1
-3
votes
1 answer

Regular expression to replace part of the expression in a json object

I am trying to write a regular expression for replacing some of the problematic characters in a json file object. Here is the short -DEMO I am able to write the php code but i am not able to implement it in R with str_replace as it starts with ,{…
user3570187
  • 1,743
  • 3
  • 17
  • 34
1 2 3
8
9