2020-10-27 00:21:24 +03:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
% Please edit documentation in R/supporting_functions.R
|
|
|
|
\name{check_inputs}
|
|
|
|
\alias{check_inputs}
|
|
|
|
\title{Check whether a data frame contains all the required variable}
|
|
|
|
\usage{
|
|
|
|
check_inputs(input, requirements, return = "stop")
|
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{input}{Pass a data frame for checking}
|
|
|
|
|
|
|
|
\item{requirements}{A character vector specifying the required variable names}
|
|
|
|
|
|
|
|
\item{return}{A character string specifying what to return.
|
|
|
|
The default value is "stop". Also accepts "names" and "warning".}
|
|
|
|
}
|
|
|
|
\value{
|
2021-03-04 21:33:28 +03:00
|
|
|
The default behaviour is to return an error message, informing the
|
|
|
|
user what variables are not included. When \code{return} is set to "names", a
|
|
|
|
character vector containing the unmatched variable names is returned.
|
2020-10-27 00:21:24 +03:00
|
|
|
}
|
|
|
|
\description{
|
|
|
|
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.
|
|
|
|
}
|
|
|
|
\examples{
|
|
|
|
|
2021-02-06 16:49:14 +03:00
|
|
|
# Return error message
|
2020-10-27 00:21:24 +03:00
|
|
|
\dontrun{
|
|
|
|
check_inputs(iris, c("Sepal.Length", "mpg"))
|
|
|
|
}
|
|
|
|
|
2021-02-06 16:49:14 +03:00
|
|
|
#' # Return warning message
|
2020-10-27 00:21:24 +03:00
|
|
|
check_inputs(iris, c("Sepal.Length", "mpg"), return = "warning")
|
|
|
|
|
2021-02-06 16:49:14 +03:00
|
|
|
# Return variable names
|
2020-10-27 00:21:24 +03:00
|
|
|
check_inputs(iris, c("Sepal.Length", "Sepal.Width", "RandomVariable"), return = "names")
|
|
|
|
|
|
|
|
}
|
2021-03-05 00:20:34 +03:00
|
|
|
\seealso{
|
|
|
|
Other Support:
|
|
|
|
\code{\link{camel_clean}()},
|
|
|
|
\code{\link{combine_signals}()},
|
|
|
|
\code{\link{cut_hour}()},
|
|
|
|
\code{\link{extract_date_range}()},
|
2021-03-05 01:19:07 +03:00
|
|
|
\code{\link{extract_hr}()},
|
2021-03-05 14:18:35 +03:00
|
|
|
\code{\link{heat_colours}()},
|
|
|
|
\code{\link{is_date_format}()},
|
2021-03-05 17:05:00 +03:00
|
|
|
\code{\link{maxmin}()},
|
|
|
|
\code{\link{p_test}()},
|
|
|
|
\code{\link{pairwise_count}()},
|
|
|
|
\code{\link{plot_WOE}()},
|
|
|
|
\code{\link{read_preamble}()},
|
|
|
|
\code{\link{rgb2hex}()},
|
|
|
|
\code{\link{totals_bind}()},
|
|
|
|
\code{\link{totals_col}()},
|
|
|
|
\code{\link{totals_reorder}()},
|
|
|
|
\code{\link{tstamp}()},
|
|
|
|
\code{\link{us_to_space}()},
|
|
|
|
\code{\link{wrap}()}
|
2021-03-05 00:20:34 +03:00
|
|
|
}
|
|
|
|
\concept{Support}
|