Find a Stored Value (Non-Blocking Version)

Share:

Description

Attempt to find a value associated with a variable from the shared netWorkSpace; a non-blocking version of nwsFind.

Usage

1
2
## S4 method for signature 'netWorkSpace'
nwsFindTry(.Object, xName, defaultVal=NULL)

Arguments

.Object

a netWorkSpace class object

xName

name of variable to be found

defaultVal

value to return if xName is not found

Details

The nwsFindTry method looks in the shared netWorkSpace .Object for a value bound to xName; if it finds such a value, nwsFindTry returns it but does not remove it. If it does not find a value, nwsFindTry returns immediately, rather than blocking as in the case of nwsFind), and the value of argument defaultVal is returned. By default, defaultVal is NULL.

If there is more than one value associated with xName, the particular value returned depends on xName's behavior. See nwsDeclare for details.

See Also

nwsDeclare, nwsFind

Examples

1
2
3
4
5
## Not run: 
ws <- netWorkSpace('nws example')
x <- nwsFindTry(ws, 'abc', -1)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.