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

R: manipulate the list name

Here is my minimal reproducible example: temp = list() temp$rows$`1`$rows$name <- "rows" temp$rows$`1`$rows$`1`$cells$name <- "cells" temp$rows$`2`$rows$name <- "rows" temp$rows$`2`$rows$`2`$cells$name <- "cells" Current…
Joanna
  • 663
  • 7
  • 21
0
votes
1 answer

Convert json file with multiple lines to R dataframe

I'm using jsonr to read a JSON file in to R. However, the fromJSON(file="file.json") command is only reading the first line of the file. Here's the…
Moon_Watcher
  • 416
  • 1
  • 6
  • 19
0
votes
1 answer

R: lexical error: invalid char in json text

I am converting from python to R and this is my first attempt at Parsing Json. I have tried jsonlite, RJSONIO, and rjson. All of them stop at the getlabskaters <- fromJSON(getlabskatersRaw). To explain this script a little bit, because I clearly…
Mike.J
  • 117
  • 1
  • 10
0
votes
1 answer

Read nested JSON in R

I have a JSON object that looks like this. This is coming from the stock market as a JSON. { "Meta Data": { "1. Information": "Daily Time Series with Splits and Dividend Events", "2. Symbol": "NSE:20MICRONS", "3. Last…
NinjaR
  • 621
  • 6
  • 22
0
votes
1 answer

Getting Discrete Value supplied to continuous scale while using ggplot

I have the below data: library(rjson) library(ggplot2) l='[{"a": "abc", "date": "20190506","model": "honda", "features":"weather", "value": 10}, {"a": "abc", "date": "20190506","model": "honda", "features":"bad", "value": 14}, {"a": "abc", "date":…
user15051990
  • 1,835
  • 2
  • 28
  • 42
0
votes
0 answers

How to convert JSON data into R

[ { "type": ["MixedExponential"], "mean": [16105.5], "sd": [44733.7177], "means": [2456, 545, 83553, 2432, 65546], "weights": [0.2, 0.4, 0.1, 0.2, 0.1] }, { "type": ["Normal"], "mean": [15000], "sd": [10000] …
0
votes
0 answers

Creating Attribute:Value Pairs in JSON Format

I am basically trying to replicate the following json structure with jsonlite (any other package like rson would also be fine if it works better). { "classes": [1, 2, 3], "ID": 0, "Name": "Peter", "Address": "" } My approach so far:…
vanao veneri
  • 970
  • 2
  • 12
  • 31
0
votes
1 answer

Rofxord: how to change the endpoint and connect with API Azure Cognitive Service?

I try to connect with Azure Cognitive Service using Roxford package. I got error propably due to wrong endpoint (after including Oxford Project into Azure Services there are several, region specific end points). I got the key from personal account…
Mikołaj
  • 385
  • 4
  • 17
0
votes
1 answer

Automatic upload json files via API using R

I want take financial data using API. I do so. #load jsons library("rjson") json_file <- "https://api.coindesk.com/v1/bpi/currentprice/USD.json" json_data <- fromJSON(paste(readLines(json_file), collapse="")) #get json content as data.frame x =…
psysky
  • 3,037
  • 5
  • 28
  • 64
0
votes
1 answer

retrieve jsonfile with financial data using R in data frame

So, here json file https://api.coindesk.com/v1/bpi/currentprice/USD.json I parse json in this way library("rjson") json_file <- "https://api.coindesk.com/v1/bpi/currentprice/USD.json" json_data <- fromJSON(paste(readLines(json_file),…
psysky
  • 3,037
  • 5
  • 28
  • 64
0
votes
1 answer

use data.table variable in json request

I have a basic table that looks like this: df = data.table(id1 = c(22,23,45,78,96,45,21,58), id2 = c(24,84,64,82,84,53,54,85)) I'm trying to lookup information in a nested json. A basic request that works with my current json file is the following…
JBR
  • 21
  • 6
0
votes
2 answers

I have a column in a data frame full of JSON format with varying length in each row

I have dataframe column containing JSON format of varying length(i mean the values), i have used--fromJSON function and parse it, but it contains multiple nested lists and I don't know how to separate each value in the JSON into a multiple…
0
votes
1 answer

Using the package RAdwords in an R script on a Unix server Error in rjson

I have the following script, which works perfectly fine, when I run it on my local PC: library(RAdwords) autX <- doAuth() data <- getData(clientCustomerId='xxx-xxx-xxxx', google_auth=autx ) However, when…
nexonvantec
  • 572
  • 1
  • 5
  • 18
0
votes
0 answers

Transform json into table where attributes come columns and objects come rows

I'm running some scripts in version 3.4.1 using Rstudio. What I need ? Transform json into table where attributes come columns and objects come rows That's the script: library(data.table) library(jsonlite) url <-…
0
votes
0 answers

Accessing only second sub-element from json object in r

This is a sample rows from json object. row1) {"results":[{"address_components":[{"long_name":"16","short_name":"16","types":["street_number"]},{"long_name":"Bhagwan Tatyasaheb Kawade Road","short_name":"BT Kawde…
Andre_k
  • 1,680
  • 3
  • 18
  • 41
1 2 3
8 9