Rev 43114 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/name.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Development Team% Distributed under GPL 2 or later\name{name}\alias{name}%\alias{symbol} use for plotmath as from R 2.6.0\alias{is.symbol}\alias{as.symbol}\alias{as.name}\alias{is.name}\title{Names and Symbols}\description{A \sQuote{name} (also known as a \sQuote{symbol}) is a way to refer to\R objects by name (rather than the value of the object, if any, boundto that name).\code{as.name} and \code{as.symbol} are identical: they attempt tocoerce the argument to a name.\code{is.symbol} and the identical \code{is.name} return \code{TRUE}or \code{FALSE} depending on whether the argument is a name or not.}\usage{as.symbol(x)is.symbol(x)as.name(x)is.name(x)}\arguments{\item{x}{object to be coerced or tested.}}\details{\code{as.name} first coerces its argument internally to a charactervector (so methods for \code{as.character} are not used). It thentakes the first element and provided it is not \code{""}, returns asymbol of that name (and if the element is \code{NA_character_}, thename is \code{`NA`}.\code{as.name} is implemented as \code{\link{as.vector}(x, "symbol")},and hence will dispatch methods for the generic function \code{as.vector}.}\value{For \code{as.name} and \code{as.symbol}, an \R object of type\code{"symbol"} (see \code{\link{typeof}}).For \code{is.name} and \code{is.symbol}, a length-one logical vectorwith value \code{TRUE} or \code{FALSE}.}\note{The term \sQuote{symbol} is from the LISP background of \R, whereas\sQuote{name} has been the standard S term for this.}\references{Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)\emph{The New S Language}.Wadsworth \& Brooks/Cole.}\seealso{\code{\link{call}}, \code{\link{is.language}}.For the internal object mode, \code{\link{typeof}}.\code{\link{plotmath}} for another use of \sQuote{symbol}.}\examples{an <- as.name("arrg")is.name(an) # TRUEmode(an) # nametypeof(an) # symbol}\keyword{programming}\keyword{attribute}