valid_syntax | R Documentation |
Try to parse()
the code and see if an error occurs.
valid_syntax(code, silent = TRUE)
code |
A character vector of R source code. |
silent |
Whether to suppress the error message when the code is not valid. |
TRUE
if the code could be parsed, otherwise FALSE
.
xfun::valid_syntax("1+1")
xfun::valid_syntax("1+")
xfun::valid_syntax(c("if(T){1+1}", "else {2+2}"), silent = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.