A ‘name’ (also known as a ‘symbol’) is a way to refer to R objects by name (rather than the value of the object, if any, bound to that name).
as.symbol are identical: they attempt to
coerce the argument to a name.
is.symbol and the identical
FALSE depending on whether the argument is a name or not.
1 2 3 4 5
object to be coerced or tested.
Names are limited to 10,000 bytes (and were to 256 bytes in versions of R before 2.13.0).
as.name first coerces its argument internally to a character
vector (so methods for
as.character are not used). It then
takes the first element and provided it is not
"", returns a
symbol of that name (and if the element is
as.name is implemented as
and hence will dispatch methods for the generic function
is.symbol are primitive functions.
as.symbol, an R object of type
is.symbol, a length-one logical vector
The term ‘symbol’ is from the LISP background of R, whereas ‘name’ has been the standard S term for this.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
For the internal object mode,
plotmath for another use of ‘symbol’.
1 2 3 4
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.