json_is_valid | R Documentation |
Uses jsonlite::validate()
under the hood.
json_is_valid(x)
json_assert_valid(x, x_arg = "", ..., error_call = caller_env())
x |
A character vector. |
x_arg |
Argument name for |
... |
These dots are for future extensions and must be empty. |
error_call |
The execution environment of a currently running function,
e.g. |
json_is_valid()
returns a vector of TRUE
and FALSE
.
json_assert_valid()
either throws an error with information on the
invalid elements or returns x
invisibly
json_is_valid("[1, 2]")
json_is_valid("[1, 2")
json_assert_valid("[1, 2]")
## Not run:
json_assert_valid("[1, 2")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.