1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/coercion.R
\name{is2}
\alias{is2}
\title{Alternative version of is}
\usage{
is2(x, class, .xname = get_name_in_parent(x))
}
\arguments{
\item{x}{Input to check.}
\item{class}{Target class that \code{x} maybe belong to.}
\item{.xname}{Not intended to be used directly.}
}
\value{
\code{TRUE} if x belongs to the class and \code{FALSE}
otherwise.
}
\description{
If a function named \code{is.class} exists, call \code{is.class(x)}.
If not, call \code{is(x, class)}.
}
\examples{
is2(1:5, "character")
is2(matrix(1:5), "character")
is2(1:5, c("character", "list", "numeric"))
is2(mean, c("function", "data.frame"))
}
\seealso{
\code{\link[methods]{is}}, and
\code{\link[assertive.types]{assert_is_all_of}} for the corresponding assert fns.
}
|