% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/type-check-scalar.R
\name{check_type_scalar}
\alias{check_type_scalar}
\alias{check_bool}
\alias{check_string}
\title{Check argument type (scalar)}
\usage{
check_bool(
  x,
  ...,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
)

check_string(
  x,
  ...,
  allow_empty = TRUE,
  allow_na = FALSE,
  allow_null = FALSE,
  arg = caller_arg(x),
  call = caller_env()
)
}
\arguments{
\item{x}{The argument to check.}

\item{...}{Additional arguments passed to \code{\link[=abort]{abort()}}.}

\item{allow_na}{Whether \code{NA} values are allowed.}

\item{allow_null}{Whether \code{NULL} is allowed.}

\item{arg}{An argument name as a string. This argument
will be mentioned in error messages as the input that is at the
origin of a problem.}

\item{call}{The execution environment of a currently
running function, e.g. \code{caller_env()}. The function will be
mentioned in error messages as the source of the error. See the
\code{call} argument of \code{\link[=abort]{abort()}} for more information.}

\item{allow_empty}{Whether the empty string \code{""} is allowed
(\code{check_string()} only).}
}
\value{
\code{NULL} invisibly if the check passes, throws an error otherwise.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#experimental}{\figure{lifecycle-experimental.svg}{options: alt='[Experimental]'}}}{\strong{[Experimental]}}

These functions check that an argument is of the expected scalar type
and produce friendly error messages otherwise.
}
\examples{
check_bool(TRUE)
try(check_bool(1))

check_string("hello")
try(check_string(42))

}
\seealso{
Other input checkers:
\code{\link[=check_data_frame]{check_data_frame()}},
\code{\link{check_type_number}},
\code{\link[=stop_input_type]{stop_input_type()}}
}
\concept{input checkers}
