Description Usage Details Value Examples
These functions return functions which can be passed to the fields
list of a FormStage
object. The created functions
check their inputs and return NULL
or an error message.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
The examples are mostly self-explanatory.
all_of
checks each of the functions it is passed.
A function for checking a form input
1 2 3 4 5 6 7 8 9 10 11 12 | f1 <- is_whole_number()
f1("pi", 3.141)
is_one_of(1:3)("The variable", 3)
is_one_of(1:3)("The variable", 4)
is_one_of("a", "b", 2:7)("The variable", 1)
length_between(3,5)("The string", "abcdef")
length_at_least(5)("The string", "abcd")
f1 <- all_of(is_whole_number(), is_between(3,5))
f1("The variable", 2)
f1("The variable", 2.5)
f1("The variable", 3.5)
f1("The variable", 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.