getSym {refer} | R Documentation |
Extract or Set Reference Symbol
Description
Functions to obtain or set the object name to which a ref
or sref
object points.
Usage
getSym(x)
setSym(x, sym)
Arguments
x |
object of class |
sym |
symbol or character naming the object to which the reference points |
Value
character of length 1
Examples
x <- 1:10
ref_to_x <- ref(x)
ref_env <- getEnv(ref_to_x)
ref_sym <- getSym(ref_to_x)
identical(ref_env, .GlobalEnv)
identical(ref_sym, "x")
y <- 500
ref_to_x <- setSym(ref_to_x, y)
!ref_to_x
[Package refer version 0.1.0 Index]