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")
)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.
String with variable to check.
String with label for var, e.g.
name of associated parameter.
(Named) character vector with extra variables
in var which shouldn't be checked.
(Named) character vector with set of reference variables.
String with label for the reference
Data.frame with data.
String with type of message returned, either a 'warning' (default) or an error.
Laure Cougnaud