The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
RJSONIO converts data between R objects and JSON text.
The main entry points are fromJSON() for parsing JSON and
toJSON() for serializing R objects.
Use fromJSON() with JSON text, a file path, or a
connection.
fromJSON('{"name": "RJSONIO", "active": true, "values": [1, 2, 3]}')
#> $name
#> [1] "RJSONIO"
#>
#> $active
#> [1] TRUE
#>
#> $values
#> [1] 1 2 3Character input that starts with { or [ is
treated as JSON content. A plain file path is read from disk.
Use toJSON() to serialize common R objects.
value <- list(
id = 1,
name = "RJSONIO",
values = c(1, 2, 3),
active = TRUE
)
json <- toJSON(value, pretty = TRUE)
cat(json)
#> {
#> "id" : 1,
#> "name" : "RJSONIO",
#> "values" : [
#> 1,
#> 2,
#> 3
#> ],
#> "active" : true
#> }The result can be parsed back into R.
isValidJSON() checks whether JSON text can be
parsed.
Round trips are most direct for simple vectors and lists whose JSON representation maps cleanly back to base R types.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.