tryGet | R Documentation |
Try to get the value of a symbol if exists or return a default value
tryGet(symbol, def = NULL, ..., envir = parent.frame())
symbol |
the symbol to examine |
def |
the default value if the symbol does not exist |
... |
additional parameters passed to |
envir |
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.
x <- list(a=c(x=1,y=2),b=c(x=2,p=3)) list.map(x, tryGet(y,0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.