Learn R Programming

nws (version 1.6.3)

nwsFindTryFile: netWorkSpace Class Method

Description

Find a value of a workspace variable and write it to a file.

Usage

## S3 method for class 'netWorkSpace':
nwsFindTryFile(.Object, xName, fObj)

Arguments

.Object
a netWorkSpace object
xName
name of the variable to find
fObj
File to write data to

Details

The nwsFindTryFile method trys to find a value in the variable specified by 'xName'. If found, it writes the value to the file object, and the method returns TRUE. If it is not found, it simply returns FALSE.

See Also

nwsFetchTryFile, nwsFindTry

Examples

Run this code
ws <- netWorkSpace('nws example')
nwsStore(ws, 'x', 'Hello, world\n')
if (nwsFindTryFile(ws, 'x', 'hello.txt')) {
  cat('success\n')
} else {
  cat('failure\n')
}

Run the code above in your browser using DataLab