Learn R Programming

Rdsm (version 1.1.0)

cnewdsm: cnewdsm

Description

Create a new Rdsm or bigmemory variable.

Usage

cnewdsm(varname,thisclass,thismode=NULL,val) 
newdsm(varname,thisclass,thismode=NULL,val=NULL,size=NULL) 
newbm(varname,thismode,nr,nc,val=NULL)

Arguments

varname
Name of variable to be created.
thisclass
Class of Rdsm variable: "dsmv", "dsmm" or "dsml".
thismode
Rmode of variable: NULL for the "dsml" Rdsm case, "integer" or "double" for the other cases; "double" is recommended for bigmemory.
val
Initial value of variable.
size
Size of Rdsm variable: length for a vector, row/col dimension for a matrix.
nr
Number of rows of bigmemory variable.
nc
Number of columns of bigmemory variable

Details

The functions cnewdsm() and newdsm() create new Rdsm variables, while newbm() creates new bigmemory variables.

For Rdsm variables, one ordinarily calls cnewdsm(), resorting to newdsm() only if finer control is needed.

In the case of cnewdsm(), all clients execute the same call. But if the initial value of the variable is to be that of a non-shared variable in some thread, then that thread calls the function newdsm() with a non-NULL val but a NULL size, while the other clients specify NULL for val but a non-NULL for size.

For bigmemory variables, val is not very useful; it's easier to leave it at NULL and then set the variable after the call.