wpa/man/check_inputs.Rd

64 строки
1.8 KiB
Plaintext
Исходник Обычный вид История

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{
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{
# Return error message
2020-10-27 00:21:24 +03:00
\dontrun{
check_inputs(iris, c("Sepal.Length", "mpg"))
}
#' # Return warning message
2020-10-27 00:21:24 +03:00
check_inputs(iris, c("Sepal.Length", "mpg"), return = "warning")
# Return variable names
2020-10-27 00:21:24 +03:00
check_inputs(iris, c("Sepal.Length", "Sepal.Width", "RandomVariable"), return = "names")
}
\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}()},
\code{\link{heat_colours}()},
\code{\link{is_date_format}()},
\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}()}
}
\concept{Support}