powered by
Try to get the value of a symbol if exists or return a default value
tryGet(symbol, def = NULL, ..., envir = parent.frame())
the symbol to examine
the default value if the symbol does not exist
additional parameters passed to exists and get
exists
get
the environment to examine whether the symbol exists and get the symbol
By default, the symbol is examined in envir without inheritance, that is, if the symbol does not exist in envir the default value def will be returned.
envir
def
# NOT RUN { x <- list(a=c(x=1,y=2),b=c(x=2,p=3)) list.map(x, tryGet(y,0)) # }
Run the code above in your browser using DataLab