getSym {refer} | R Documentation |
Functions to obtain or set the object name to which a ref
or sref
object points.
getSym(x)
setSym(x, sym)
x |
object of class |
sym |
symbol or character naming the object to which the reference points |
character of length 1
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