is_value | R Documentation |
Checks if input fits the requirements and gives feedback
via give_feedback()
.
is_value(
x,
mode,
ref = NULL,
fdb.fn = "stop",
verbose = TRUE,
skip.allow = FALSE,
skip.val = NULL,
with.time = FALSE
)
is_vec(
x,
mode,
ref = NULL,
of.length = NULL,
min.length = NULL,
max.length = NULL,
skip.allow = FALSE,
skip.val = NULL,
fdb.fn = "stop",
verbose = TRUE,
with.time = FALSE
)
are_values(
...,
mode,
fdb.fn = "stop",
verbose = TRUE,
with.time = FALSE,
skip.allow = FALSE,
skip.val = NULL,
return = "boolean"
)
are_vectors(
...,
mode,
fdb.fn = "stop",
verbose = TRUE,
with.time = FALSE,
of.length = NULL,
min.length = NULL,
max.length = NULL,
skip.allow = FALSE,
skip.val = NULL,
return = "boolean"
)
x |
Input vector. |
mode |
Character value. The type of which the input must be. |
ref |
Character value. Input reference for the error message.
If set to NULL the value of |
fdb.fn |
Character value. Determines the function to call if a feedback message needs to be given. One of 'stop', 'warning' or 'message'. |
verbose |
Logical value. Indicates whether any kind of feedback is supposed to
be given. |
skip.allow |
Logical. Allows the function to be skipped if |
skip.val |
The value that |
with.time |
Logical value. Indicates whether the current time is to be added to the feedback message. |
of.length |
Numeric value. Denotes that the vector has to be of a certain length.
Holds priority over |
min.length , max.length |
Numeric value. Denotes that the vector has to be of certain minimal and/or maximal length. |
... |
Character vector denoting the objects to be checked. |
return |
Character value. Either 'boolean' which makes the function return an invisible TRUE or FALSE depending on if all tests evaluated to TRUE or not. Or 'results' which returns a named vector of all results. |
An invisible TRUE or an informative error message.
# Not run:
vec1 <- c(1,2),
vec2 <- c(1,2,3,4,5)
is_vec(x = vec1, mode = "numeric", of.length = 2)
are_vectors(c("vec1", "vec2"), mode = "numeric", min.length = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.