Options Settings
options.Rd
Allow the user to set and examine a variety of options which affect the way in which R computes and displays sparse matrix results.
Details
Invoking 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 getOption("spam.eps")
, e.g., rather than
options("spam.eps")
which is a list of length one.
Of course, printing is still subordinate to
getOption("max.print")
or similar options.
Value
For getOption
, the current value set for option x
, or
NULL
if the option is unset.
For options()
, a list of all set options sorted by category. For
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 for the package spam
A short description with the default values follows.
spam.eps=.Machine$double.eps
:values smaller than this are considered as zero. This is only used when creating spam objects.
spam.drop=FALSE
:default parameter for
drop
when subsettingspam.printsize=100
:the max number of elements of a matrix which we display as regular matrix.
spam.imagesize=10000
:the max number of elements of a matrix we display as regular matrix with
image
ordisplay
. Larger matrices are represented as dots only.spam.cex=1200
:default dot size for
image
ordisplay
.spam.structurebased=FALSE
:should operations be carried out on the nonzero entries (the structure) or including the zeros.
spam.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
toInf
.spam.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.spam.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.spam.dopivoting=TRUE
:default parameter for "
solve
" routines.FALSE
would solve the system without using the permutation.spam.NAOK=FALSE
:logical determines if
NA
,NaN
andInf
are allowed to Fortan. Setting toTRUE
allows to work with these but full functionality has not been tested.spam.safemodevalidity=TRUE
:logical determines if sanity check is peformed when constructing sparse matrices. Default is safer but somewhat slower.
spam.cholsymmetrycheck=TRUE
:for the Cholesky factorization, verify if the matrix is symmetric.
spam.cholpivotcheck=TRUE
:for the Cholesky factorization, when passing a permutation, should a minimum set of checks be performed?
spam.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"
.spam.cholincreasefactor=c(1.25,1.25)
:If not enought memory could be allocated, these are the steps to increase it.
spam.nnznearestdistnnz=c(400^2,400)
:Memory allocation parameters for
nearest.dist
.spam.nearestdistincreasefactor=1.25
:If not enought memory could be allocated, this is the step to increase it.
See also
Functions influenced by these options include: print.spam
,
display.spam
, image.spam
, upper.tri.spam
,
chol.spam
, nearest.dist
, etc.powerboost
Examples
smat <- diag.spam( 1:8)
smat
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
#> [1,] 1 0 0 0 0 0 0 0
#> [2,] 0 2 0 0 0 0 0 0
#> [3,] 0 0 3 0 0 0 0 0
#> [4,] 0 0 0 4 0 0 0 0
#> [5,] 0 0 0 0 5 0 0 0
#> [6,] 0 0 0 0 0 6 0 0
#> [7,] 0 0 0 0 0 0 7 0
#> [8,] 0 0 0 0 0 0 0 8
#> Class 'spam' (32-bit)
options(spam.printsize=49)
smat
#> [1] 1 2 3 4 5 6 7 8
#> Class 'spam' (32-bit)
# List all spam options:
options()[grep("spam",names(options()))]
#> $spam.NAOK
#> [1] FALSE
#>
#> $spam.cex
#> [1] 1200
#>
#> $spam.cholincreasefactor
#> [1] 1.25 1.25
#>
#> $spam.cholpivotcheck
#> [1] TRUE
#>
#> $spam.cholsymmetrycheck
#> [1] TRUE
#>
#> $spam.cholupdatesingular
#> [1] "warning"
#>
#> $spam.dopivoting
#> [1] TRUE
#>
#> $spam.drop
#> [1] FALSE
#>
#> $spam.eps
#> [1] 2.220446e-16
#>
#> $spam.force64
#> [1] FALSE
#>
#> $spam.imagesize
#> [1] 10
#>
#> $spam.inefficiencywarning
#> [1] 1e+06
#>
#> $spam.listmethod
#> [1] "PE"
#>
#> $spam.nearestdistincreasefactor
#> [1] 1.3
#>
#> $spam.nearestdistnnz
#> [1] 250000 500
#>
#> $spam.printsize
#> [1] 49
#>
#> $spam.safemodevalidity
#> [1] TRUE
#>
#> $spam.structurebased
#> [1] FALSE
#>
#> $spam.trivalues
#> [1] TRUE
#>
#> $spam.validate
#> [1] FALSE
#>
# Reset to default values:
options(spam.eps=.Machine$double.eps,
spam.drop=FALSE,
spam.printsize=100,
spam.imagesize=10000,
spam.cex=1200,
spam.structurebased=FALSE,
spam.inefficiencywarning=1e6,
spam.trivalues=FALSE,
spam.listmethod="PE",
spam.NAOK=FALSE,
spam.safemodevalidity=TRUE,
spam.dopivoting=TRUE,
spam.cholsymmetrycheck=TRUE,
spam.cholpivotcheck=TRUE,
spam.cholupdatesingular="warning",
spam.cholincreasefactor=c(1.25,1.25),
spam.nearestdistincreasefactor=1.25,
spam.nearestdistnnz=c(400^2,400))