View source: R/miscellaneous.R
checkVar | R Documentation |
Filter variables not present in the data or in reference set with a warning, and only returned filtered vector, or NULL if empty.
checkVar(
var,
varLabel,
varUncheck = NULL,
varRef,
refLabel = ifelse(!missing(varRef), "reference variable", "data"),
data,
msgType = c("warning", "error")
)
var |
String with variable to check. |
varLabel |
String with label for |
varUncheck |
(Named) character vector with extra variables
in |
varRef |
(Named) character vector with set of reference variables. |
refLabel |
String with label for the reference |
data |
Data.frame with data. |
msgType |
String with type of message returned, either a 'warning' (default) or an error. |
Depending on msgType
:
warning
: warning is printed in the console, and a
var
filtered with element not in data
or in refSet
is returned.
If filtered var
is empty, NULL is returned.
error
: an error is triggered.
Laure Cougnaud
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.