| Line 33... |
Line 33... |
| 33 |
\item{x}{object to be coerced or tested.}
|
33 |
\item{x}{object to be coerced or tested.}
|
| 34 |
}
|
34 |
}
|
| 35 |
\details{
|
35 |
\details{
|
| 36 |
Names are limited to 10,000 bytes (and were to 256 bytes in versions
|
36 |
Names are limited to 10,000 bytes (and were to 256 bytes in versions
|
| 37 |
of \R before 2.13.0).
|
37 |
of \R before 2.13.0).
|
| 38 |
|
38 |
|
| 39 |
\code{as.name} first coerces its argument internally to a character
|
39 |
\code{as.name} first coerces its argument internally to a character
|
| 40 |
vector (so methods for \code{as.character} are not used). It then
|
40 |
vector (so methods for \code{as.character} are not used). It then
|
| 41 |
takes the first element and provided it is not \code{""}, returns a
|
41 |
takes the first element and provided it is not \code{""}, returns a
|
| 42 |
symbol of that name (and if the element is \code{NA_character_}, the
|
42 |
symbol of that name (and if the element is \code{NA_character_}, the
|
| 43 |
name is \code{`NA`}).
|
43 |
name is \code{`NA`}).
|
| 44 |
|
44 |
|
| 45 |
\code{as.name} is implemented as \code{\link{as.vector}(x, "symbol")},
|
45 |
\code{as.name} is implemented as \code{\link{as.vector}(x, "symbol")},
|
| 46 |
and hence will dispatch methods for the generic function \code{as.vector}.
|
46 |
and hence will dispatch methods for the generic function \code{as.vector}.
|
| 47 |
|
47 |
|
| 48 |
\code{is.name} and \code{is.symbol} are \link{primitive} functions.
|
48 |
\code{is.name} and \code{is.symbol} are \link{primitive} functions.
|
| 49 |
}
|
49 |
}
|
| 50 |
\value{
|
50 |
\value{
|
| 51 |
For \code{as.name} and \code{as.symbol}, an \R object of type
|
51 |
For \code{as.name} and \code{as.symbol}, an \R object of type
|
| 52 |
\code{"symbol"} (see \code{\link{typeof}}).
|
52 |
\code{"symbol"} (see \code{\link{typeof}}).
|