Learn R Programming

spam (version 1.4-0)

options: Options Settings

Description

Allow the user to set and examine a variety of options which affect the way in which R computes and displays sparse matrix results.

Usage

spam.options(…)

spam.getOption(x)

Arguments

any options can be defined, using name = value or by passing a list of such tagged values. However, only the ones below are used in spam. Further, spam.options('name') == spam.options()['name'], see the example.

x

a character string holding an option name.

Value

For spam.getOption, the current value set for option x, or NULL if the option is unset.

For spam.options(), a list of all set options sorted by category. For spam.options(name), a list of length one containing the set value, or NULL if it is unset. For uses setting one or more options, a list with the previous values of the options changed (returned invisibly).

Options used

A short description with the default values follows.

eps=.Machine$double.eps:

values smaller than this are considered as zero. This is only used when creating spam objects.

drop=FALSE:

default parameter for drop when subsetting

printsize=100:

the max number of elements of a matrix which we display as regular matrix.

imagesize=10000:

the max number of elements of a matrix we display as regular matrix with image or display. Larger matrices are represented as dots only.

cex=1200:

default dot size for image or display.

structurebased=FALSE:

should operations be carried out on the nonzero entries (the structure) or including the zeros.

inefficiencywarning=1e6:

issue a warning when inefficient operations are performed and the matrix exceeds the specified size. Valid value is a postive integer or a logical. TRUE corresponds to 1 (always), FALSE to Inf.

trivalues=FALSE:

a flag whether to return the structure (FALSE) or the values themselves (TRUE) when returning the upper and lower triangular part of a matrix.

listmethod="PE":

algorithm for spam.list. Default is suggestion by Paul Eilers (thanks). Any other specification uses a bubble sort algorithm which is only slightly faster for very sparse matrices.

dopivoting=TRUE:

default parameter for "solve" routines. FALSE would solve the system without using the permutation.

NAOK=FALSE:

logical determines if NA, NaN and Inf are allowed to Fortan. Setting to TRUE allows to work with these but full functionality has not been tested.

safemodevalidity=TRUE:

logical determines if sanity check is peformed when constructing sparse matrices. Default is safer but somewhat slower.

cholsymmetrycheck=TRUE:

for the Cholesky factorization, verify if the matrix is symmetric.

cholpivotcheck=TRUE:

for the Cholesky factorization, when passing a permutation, should a minimum set of checks be performed?

cholupdatesingular="warning":

for a Cholesky update, what happens if the matrix is singular: "warning" only and returning the not updated factor, "error" or return simply "NULL".

cholincreasefactor=c(1.25,1.25):

If not enought memory could be allocated, these are the steps to increase it.

nnznearestdistnnz=c(400^2,400):

Memory allocation parameters for nearest.dist.

nearestdistincreasefactor=1.25:

If not enought memory could be allocated, this is the step to increase it.

Details

Invoking spam.options() with no arguments returns a list with the current values of the options. To access the value of a single option, one should use spam.getOption("eps"), e.g., rather than spam.options("eps") which is a list of length one.

Internally, the options are kept in the list .Spam.

Of course, printing is still subordinate to getOption("max.print") or similar options.

See Also

Functions influenced by these options include: print.spam, display.spam, image.spam, upper.tri.spam, chol.spam, nearest.dist, etc. powerboost

Examples

Run this code
op <- spam.options()

# two ways of representing the options nicely.
utils::str(op)
noquote(format(op) )


smat <- diag.spam( 1:8)
smat
spam.options( printsize=49)
smat


# Reset to default values:
spam.options( eps=.Machine$double.eps, drop=FALSE,             
   printsize=100, imagesize=10000, cex=1200, 
   structurebased=FALSE, inefficiencywarning=1e6,
   trivalues=FALSE, listmethod="PE", 
   NAOK=FALSE, safemodevalidity=TRUE, dopivoting=TRUE, 
   cholsymmetrycheck=TRUE, cholpivotcheck=TRUE,
   cholupdatesingular="warning", cholincreasefactor=c(1.25,1.25),
   nearestdistincreasefactor=1.25, nearestdistnnz=c(400^2,400)     )

Run the code above in your browser using DataLab