This is a dumb way to do this (compared to how you can impose pointers, for example, in C ++), but you could do:
# recursively iterate over environments find.by.address = function(addr, env = .GlobalEnv) { idx = which(sapply(ls(env), function(x) address(get(x, env = env))) == addr) if (length(idx) != 0) return (get(ls(env)[idx], env = env))
eddi
source share