View source: R/supporting_functions.R
| check_inputs | R Documentation |
Checks whether a data frame contains all the required variables. Matching works via variable names, and used to support individual functions in the package. Not used directly.
check_inputs(input, requirements, return = "stop")
input |
Pass a data frame for checking |
requirements |
A character vector specifying the required variable names |
return |
A character string specifying what to return. The default value is "stop". Also accepts "names" and "warning". |
The default behaviour is to return an error message, informing the
user what variables are not included. When return is set to "names", a
character vector containing the unmatched variable names is returned.
Other Support:
camel_clean(),
combine_signals(),
cut_hour(),
extract_date_range(),
extract_hr(),
heat_colours(),
is_date_format(),
maxmin(),
p_test(),
pairwise_count(),
plot_WOE(),
read_preamble(),
rgb2hex(),
totals_bind(),
totals_col(),
totals_reorder(),
tstamp(),
us_to_space(),
wrap()
# Return error message
## Not run:
check_inputs(iris, c("Sepal.Length", "mpg"))
## End(Not run)
#' # Return warning message
check_inputs(iris, c("Sepal.Length", "mpg"), return = "warning")
# Return variable names
check_inputs(iris, c("Sepal.Length", "Sepal.Width", "RandomVariable"), return = "names")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.