validate | R Documentation |
Test if a string contains valid JSON. Characters vectors will be collapsed into a single string.
validate(txt)
txt |
JSON string |
#Output from toJSON and serializeJSON should pass validation
myjson <- toJSON(mtcars)
validate(myjson) #TRUE
#Something bad happened
truncated <- substring(myjson, 1, 100)
validate(truncated) #FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.