check_data_frame | R Documentation |
Checks whether the input data.frame contains variables of certain classes and names.
check_data_frame(
df,
var.class = list(),
ref = NULL,
verbose = TRUE,
with.time = FALSE,
fdb.fn = "stop"
)
df |
A data.frame. |
var.class |
A named list. The names have to match the variable names of the data.frame that are to be validated. The respective elements specify the class the data.frame variable must have specified as character strings. |
ref |
Character value. Input reference for the error message.
If set to NULL the value of |
verbose |
Logical value. Indicates whether any kind of feedback is supposed to
be given. |
with.time |
Logical value. Indicates whether the current time is to be added to the feedback message. |
fdb.fn |
Character value. Determines the function to call if a feedback message needs to be given. One of 'stop', 'warning' or 'message'. |
An informative message, warning or error or TRUE if valid.
# make sure that the input data.frame has
# the numeric variables 'mpg' and 'cyl'.
check_data_frame(df = mtcars,
var.class = list(mpg = "numeric",
cyl = "numeric"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.