The R Project SVN R

Rev

Rev 56186 | Rev 74897 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
42333 ripley 1
% File src/library/base/man/is.function.Rd
2
% Part of the R package, http://www.R-project.org
59039 ripley 3
% Copyright 1995-2007 R Core Team
42333 ripley 4
% Distributed under GPL 2 or later
5
 
2 r 6
\name{is.function}
56186 murdoch 7
\alias{is.function}
31819 maechler 8
\alias{is.primitive}
9
\title{Is an Object of Type (Primitive) Function?}
10
\usage{
11
is.function(x)
12
is.primitive(x)
13
}
14
\description{Checks whether its argument is a (primitive) function.}
7125 hornik 15
\arguments{
16
  \item{x}{an \R object.}
2 r 17
}
23358 ripley 18
\details{
31819 maechler 19
  \code{is.primitive(x)} tests if \code{x} is a primitive function
42987 ripley 20
  (either a \code{"builtin"} or \code{"special"} as described for
48662 ripley 21
  \code{\link{typeof}})?  It is a \link{primitive} function.
23358 ripley 22
}
29362 ripley 23
\value{
31819 maechler 24
  \code{TRUE} if \code{x} is a (primitive) function, and \code{FALSE}
25
  otherwise.
7125 hornik 26
}
31819 maechler 27
\examples{
28
is.function(1) # FALSE
29
is.function(is.primitive)  # TRUE: it is a function, but ..
30
is.primitive(is.primitive) # FALSE:it's not a primitive one, whereas
31
is.primitive(is.function)  # TRUE: that one *is*
32
}
286 maechler 33
\keyword{programming}