is.function.Rd 959 Bytes
Newer Older
Radford Neal's avatar
Radford Neal committed
1 2
% File src/library/base/man/is.function.Rd
% Part of the R package, http://www.R-project.org
3
% Copyright 1995-2007 R Core Team
Radford Neal's avatar
Radford Neal committed
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
% Distributed under GPL 2 or later

\name{is.function}
\alias{is.function}
\alias{is.primitive}
\title{Is an Object of Type (Primitive) Function?}
\usage{
is.function(x)
is.primitive(x)
}
\description{Checks whether its argument is a (primitive) function.}
\arguments{
  \item{x}{an \R object.}
}
\details{
  \code{is.primitive(x)} tests if \code{x} is a primitive function
  (either a \code{"builtin"} or \code{"special"} as described for
  \code{\link{typeof}})?  It is a \link{primitive} function.
}
\value{
  \code{TRUE} if \code{x} is a (primitive) function, and \code{FALSE}
  otherwise.
}
\examples{
is.function(1) # FALSE
is.function(is.primitive)  # TRUE: it is a function, but ..
is.primitive(is.primitive) # FALSE:it's not a primitive one, whereas
is.primitive(is.function)  # TRUE: that one *is*
}
\keyword{programming}