fromJSON {rjson} | R Documentation |
Convert a JSON object into an R object.
fromJSON( json_str, file, method = "C", unexpected.escape = "error" )
json_str |
a JSON object to convert |
file |
the name of a file to read the json_str from; this can also be a URL. Only one of json_str or file must be supplied. |
method |
use the |
unexpected.escape |
changed handling of unexpected escaped characters. Handling value should be one of "error", "skip", or "keep"; on unexpected characters issue an |
R object that corresponds to the JSON object
#watch out for R turning null into FALSE fromJSON( "[true, false, null]" ) ##[1] TRUE FALSE __FALSE__ #but if you use a hash, this will be avoided fromJSON( '{"a":true, "b":false, "c":null}' ) #R vs C x <- toJSON( iris ) system.time( y <- fromJSON(x) ) system.time( y2 <- fromJSON(x,method = "R") )