save_json | R Documentation |
Save or load R object in 'JSON' format
save_json(
x,
con = stdout(),
...,
digits = ceiling(-log10(.Machine$double.eps)),
pretty = TRUE,
serialize = TRUE
)
load_json(con, ..., map = NULL)
x |
R object to save |
con |
file or connection |
... |
other parameters to pass into |
digits |
number of digits to save |
pretty |
whether the output should be pretty |
serialize |
whether to save a serialized version of |
map |
a map to save the results |
save_json
returns nothing; load_json
returns an
R object.
# Serialize
save_json(list(a = 1, b = function(){}))
# use toJSON
save_json(list(a = 1, b = function(){}), serialize = FALSE)
# Demo of using serializer
f1 <- tempfile(fileext = ".json")
save_json(x ~ y + 1, f1)
load_json(f1)
unlink(f1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.