Rev 15876 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{missing}\alias{missing}\title{Does a Formal Argument have a Value?}\usage{missing(x)}\description{\code{missing} can be used to test whether a value was specifiedas an argument to a function.}\arguments{\item{x}{a formal argument.}}\details{\code{missing(x)} is only reliable if \code{x} has not been alteredsince entering the function: in particular it will \emph{always}be true after \code{x <- match.arg(x)}.The example shows how a plotting functioncan be written to work with either a pair of vectorsgiving x and y coordinates of points to be plottedor a single vector giving y values to be plottedagainst their indexes.}\seealso{\code{\link{substitute}} for argument expression;\code{\link{NA}} for ``missing values'' in data.}\examples{myplot <- function(x,y) {if(missing(y)) {y <- xx <- 1:length(y)}plot(x,y)}}\keyword{programming}