Description Usage Arguments Value Examples
View source: R/reso_validate.R
Tests whether a string or file is an R expression. Fails with error if the string or file is invalid and soft=FALSE, returns FALSE is the file is invalid while soft=TRUE.
1 | reso_validate(file, soft = FALSE)
|
file |
string. either a path to a file or a |
soft |
logical. Should |
TRUE if the file is a valid reso
expression, FALSE otherwise.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
reso_validate("assign(a, b)") # these two fail with error
reso_validate("x(s(d(p()))) + a")
## End(Not run)
reso_validate("assign(a, b)", soft = TRUE) #is invalid, but
# soft=TRUE prevents error and the function returns FALSE instead
reso_validate("x(s(d(p()[0])))") # these two are valid code
reso_validate("x(s(d(p()[0])))(0,x(s(d(p()[0])))(!0,0[0]))")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.