Displaying 20 results from an estimated 1000 matches similar to: "Fast JSON <-> R converter?"
2009 Jun 13
1
conditional dependencies & loading
Hi!
I'm working on a package that must convert data to and from JSON. For this,
it can use either the rjson package, or preferably, the faster RJSONIO
package.
I have two related questions about this.
First, how can I specify that the package depends on *either* RJSONIO *or*
rjson? (I.e. both are not required.)
Second, what's the best-practice R idiom for such conditional loading?
2012 Dec 27
1
Convert json data to an r dataframe
Hello to everybody,
I need to convert a json dataset in an R dataframe.
I suppose that I'd need to use rjson or rjsonio package.
The json dataset is:
http://apistat.istat.it/?q=getdatajson&dataset=DCIS_POPSTRBIL&dim=1,0,0,0&lang=1&tr=&te=
It would be nice if someone can help me to create a function like the one
below:
2011 Nov 05
2
install.packages problem
I'm trying to install the rdatamarket package. I did an
install.packages('rdatamarket') command but got an error about half way
through the install as follows:
* installing *source* package ?RCurl? ...
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ?RCurl?
The install continued after the error but looks like it was completed. I'm
2012 Dec 04
1
Reading JSON files from R
Hello All -
I am trying to use RJSONIO to read in some JSON files.
I was wondering if anyone could please comment on the level of complexity of
the files it can be used to read, exports from or directly from NoSQL DBMS
like MongoDB and such.
Also, i understand that in reading the JSON file RJSONIO will automatically
create the necessary structures. However I cannot seem to use to to read the
2013 Aug 29
0
Big Integer Support in JSON-to-R Conversion
I have come across an issue converting a JSON string in R (with either the
package 'rjson' or 'RJSONIO') when big integers are included in the JSON
string.
A simple example of the problem is:
> options(scipen=999) # To prevent representing the answer in scientific
notation
> json.str <- '{"bigInt":123456789123456789}' # Sample JSON string with
big
2016 Oct 03
3
On implementing zero-overhead code reuse
On Mon, Oct 3, 2016 at 10:18 AM, <frederik at ofb.net> wrote:
> Hi Kynn,
>
> Thanks for expanding.
>
> I wrote a function like yours when I first started using R. It's
> basically the same up to your "new.env()" line, I don't do anything
> with environmentns. I just called my function "mysource" and it's
> essentially a "source
2016 Oct 03
4
On implementing zero-overhead code reuse
Hi Frederick,
I described what I meant in the post I sent to R-help
(https://stat.ethz.ch/pipermail/r-help/2016-September/442174.html),
but in brief, by "zero overhead" I mean that the only thing needed for
library code to be accessible to client code is for it to be located
in designed directory. No additional meta-files, packaging/compiling,
etc. are required.
Best,
G.
On Sun, Oct
2010 Dec 11
2
toJSON question
Hello,
I am trying to use RJSONIO
I have:
x <- c(0,4,8,9)
y <- c(3,8,5,13)
z <- cbind(x,y)
Any idea how to convert z into the JSON format below?
I want to get the following JSON output to put into a php file.
[[0, 3], [4, 8], [8, 5], [9, 13]]
Thank you.
2009 Jun 12
1
Issues converting from JSON to R
When converting from JSON to R it seems logical that a JSON array would
correspond to an "unnamed" R list, while a JSON object would correspond to a
"named" R list. E.g.
JSON: [1, 3.1415927, "foo", false, null] => R: list(1, 3.1415927, "foo",
FALSE, NA);
and
JSON { "int": 1, "float": 3.1415927, "string": "foo",
2009 May 22
2
how to insert NULLs in lists?
I'm an experienced programmer, but learning R is making me lose the little
hair I have left...
> list(NULL)
[[1]]
NULL
> length(list(NULL))
[1] 1
> x <- list()
> x[[1]] <- NULL
> x
list()
> length(x)
[1] 0
>From the above experiment, it is clear that, although one can create a
one-element list consisting of a NULL element, one can't get the same result
by
2018 May 08
0
help with json data from the web into data frame in R
That said, I have two issues to ask for help with:
1) how to ignore cert errors with a fromJSON call
And
2) why the json data from the example link doesn't convert to a data frame. As seen in the following example
library("rjson")
result <- fromJSON(file =
2018 May 09
1
help with json data from the web into data frame in R
Regarding the question:
From the linux shell I use the "-k" switch with cURL to ignore cert errors.. is there an equivalent in the R world?
I have (sometimes) had success by creating a .curlrc file and putting the necessary curl options in it. When R invokes curl, curl picks up the options.
[my context was running install.packages( method='curl' ) pointing to a local
2018 May 08
0
help with json data from the web into data frame in R
[non-tabular json data] -- ok.. so I think I need to figure out how to make it tabular. Thanks!
[curl] -- I was hoping there was a cleaner way to do it.. using R to evoke cURL to get the data as text and then passing it into getJSON seems to be what I need to do.
Do you by chance have an simple example of using RCurl to get a response ignoring cert errors?
ty
-Rich
-----Original Message-----
2016 Oct 03
2
On implementing zero-overhead code reuse
On 10/03/2016 01:51 PM, Kynn Jones wrote:
> Thank you all for your comments and suggestions.
>
> @Frederik, my reason for mucking with environments is that I want to
> minimize the number of names that import adds to my current
> environment. For instance, if module foo defines a function bar, I
> want my client code to look like this:
>
> import("foo")
>
2018 May 08
3
help with json data from the web into data frame in R
> On May 8, 2018, at 9:03 AM, Evans, Richard K. (GRC-H000) <richard.k.evans at nasa.gov> wrote:
>
> That said, I have two issues to ask for help with:
>
> 1) how to ignore cert errors with a fromJSON call
If you can do it with curl, then why aren't you doing one of a) a system call, b) installing and loading RCurl, c) installing and loading curl (the R package with that
2018 May 08
3
help with json data from the web into data frame in R
Hi David, .. I think I've got it :-)
Please let me know if you see anything glaringly wrong with this:
library(RCurl)
zWebObj <- postForm("https://www.semantic-mediawiki.org/w/api.php",
"action" = "ask",
"query" = "[[Category:City]]|?Capital%20of|?Has%20area",
"format" = "json"
.opts = list(ssl.verifypeer =
2018 May 08
0
help with json data from the web into data frame in R
Hi Rich,
Take a look at the function fromJSON found in the rjson package.
Note that the Usage in the help page: ?fromJSON
names the second argument 'file' but if you look at the description the
argument can be a URL.
HTH,
Eric
On Tue, May 8, 2018 at 6:16 PM, Evans, Richard K. (GRC-H000) <
richard.k.evans at nasa.gov> wrote:
> Hello
>
> I am able to construct a url that
2018 May 08
3
help with json data from the web into data frame in R
Right. I'm trying to access a server within my organization which has a cert error that I cannot fix.
The example link I provided was to a site on the web that does not have the cert error.
From the linux shell I use the "-k" switch with cURL to ignore cert errors.. is there an equivalent in the R world?
-Rich
-----Original Message-----
From: David Winsemius [mailto:dwinsemius
2016 Oct 02
5
On implementing zero-overhead code reuse
I'm looking for a way to approximate the "zero-overhead" model of code
reuse available in languages like Python, Perl, etc.
I've described this idea in more detail, and the motivation for this
question in an earlier post to R-help
(https://stat.ethz.ch/pipermail/r-help/2016-September/442174.html).
(One of the responses I got advised that I post my question here instead.)
The
2016 Oct 03
0
On implementing zero-overhead code reuse
Hi Kynn,
Thanks for expanding.
I wrote a function like yours when I first started using R. It's
basically the same up to your "new.env()" line, I don't do anything
with environmentns. I just called my function "mysource" and it's
essentially a "source with path". That allows me to find code I reuse
in standard locations.
I don't know why R does not