I have had success using the fromJSON() function in the rjson package.
On Thu, Jan 16, 2020 at 4:22 PM Ioanna Ioannou wrote:
> hello everyone,
>
> and happy new year!
>
> I have this problem: I want to save the name of the 'countries', the
> 'taxonomy_gem' and the 'minimum_im' and 'maximum_im' .
Hi Ioanna,
Assuming your input file is named "ii.json" and contains the text in
your original post:
library(jsonlite)
a2<-fromJSON("ii.json",flatten=TRUE)
a2$fields$geo_applicability$fields$countries[,"fields.name"]
You can find this yourself by progressively checking names and
extracting until
optimise the code?
>
> Best,
>
> ____________________
> From: Rainer M Krug
> Sent: 16 January 2020 14:47
> To: Ioanna Ioannou
> Subject: Re: [R] How to save multiple values of a variable in a json file in R
>
> Check the hep of the read_json() function and
in some cases there will be one country reported and in some
others multiple. How can i optimise the code?
Best,
From: Rainer M Krug
Sent: 16 January 2020 14:47
To: Ioanna Ioannou
Subject: Re: [R] How to save multiple values of a variable in a json file in R
Ch
4 matches
Mail list logo