toJSON <- function(x, force = TRUE, ...) {
jsonlite::toJSON(
list(
class = class(x),
object = unclass(x)
),
force = force,
...
)
}
fromJSON <- function(txt, ...) {
obj <- jsonlite::fromJSON(txt, ...)
if (is.list(obj) && identical(names(obj), c("class", "object"))) {
structure(obj$object, class = obj$class)
} else {
obj
}
}
checkFromJSON <- function(txt, ...) {
if (identical(txt, NA_character_)) {
return()
}
check <- fromJSON(txt, ...)
check$errors <- as.character(check$errors)
check$warnings <- as.character(check$warnings)
check$notes <- as.character(check$notes)
check
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.