Learn R Programming

nws (version 1.7.0.1)

nwsStoreFile: Read a Value from File and Store in netWorkSpace

Description

Store a new value into a variable in the workspace from a file.

Usage

"nwsStoreFile"(.Object, xName, fObj, n=0)

Arguments

.Object
a netWorkSpace class object.
xName
character string specifying the name of the variable to be stored
fObj
a file object or character string specifying file from which to read data to store in the variable.
n
Number of bytes to write. A value of zero means to write all the data in the file.

Details

The nwsStoreFile method works like nwsStore, except that the value to store in the netWorkSpace variable comes from a file. If fObj is a character string, nwsStoreFile calls file to obtain a file connection which is opened for the duration of the method.

See Also

nwsStore

Examples

Run this code
## Not run: 
# ws <- netWorkSpace('nws example')
# nwsStore(ws, 'x', 'Hello, world\n')
# nwsFindFile(ws, 'x', 'hello.txt')
# nwsStoreFile(ws, 'hello', 'hello.txt')
# ## End(Not run)

Run the code above in your browser using DataLab