validate.Rd
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#> [1] TRUE#> [1] FALSE #> attr(,"offset") #> [1] 1 #> attr(,"err") #> [1] "parse error: premature EOF\n [{\"mpg\":21,\"cyl\":6,\"disp\":160,\"\n (right here) ------^\n"