# spatstat.options

##### Internal Options in Spatstat Package

Allows the user to examine and reset the values of global parameters which control actions in the spatstat package.

- Keywords
- spatial

##### Usage

```
spatstat.options(...)
reset.spatstat.options()
```

##### Arguments

- …
Either empty, or a succession of parameter names in quotes, or a succession of

`name=value`

pairs. See below for the parameter names.

##### Details

The function `spatstat.options`

allows the user to examine and reset the values
of global parameters which control actions in the
spatstat package.
It is analogous to the system function `options`

.

The function `reset.spatstat.options`

resets all the
global parameters in spatstat to their original,
default values.

The global parameters of interest to the user are:

- checkpolygons
Logical flag indicating whether the functions

`owin`

and`as.owin`

should apply very strict checks on the validity of polygon data. These strict checks are no longer necessary, and the default is`checkpolygons=FALSE`

. See also`fixpolygons`

below.- checksegments
Logical flag indicating whether the functions

`psp`

and`as.psp`

should check the validity of line segment data (in particular, checking that the endpoints of the line segments are inside the specified window). It is advisable to leave this flag set to`TRUE`

.- eroded.intensity
Logical flag affecting the behaviour of the score and pseudo-score residual functions

`Gcom`

,`Gres`

`Kcom`

,`Kres`

,`psstA`

,`psstG`

,`psst`

. The flag indicates whether to compute intensity estimates on an eroded window (`eroded.intensity=TRUE`

) or on the original data window (`eroded.intensity=FALSE`

, the default).- expand
The default expansion factor (area inflation factor) for expansion of the simulation window in

`rmh`

(see`rmhcontrol`

). Initialised to`2`

.- expand.polynom
Logical. Whether expressions involving

`polynom`

in a model formula should be expanded, so that`polynom(x,2)`

is replaced by`x + I(x^2)`

and so on. Initialised to`TRUE`

.- fastpois
Logical. Whether to use a fast algorithm (introduced in spatstat 1.42-3) for simulating the Poisson point process in

`rpoispp`

when the argument`lambda`

is a pixel image. Initialised to`TRUE`

. Should be set to`FALSE`

if needed to guarantee repeatability of results computed using earlier versions of spatstat.- fastthin
Logical. Whether to use a fast C language algorithm (introduced in spatstat 1.42-3) for random thinning in

`rthin`

when the argument`P`

is a single number. Initialised to`TRUE`

. Should be set to`FALSE`

if needed to guarantee repeatability of results computed using earlier versions of spatstat.- fastK.lgcp
Logical. Whether to use fast or slow algorithm to compute the (theoretical) \(K\)-function of a log-Gaussian Cox process for use in

`lgcp.estK`

or`Kmodel`

. The slow algorithm uses accurate numerical integration; the fast algorithm uses Simpson's Rule for numerical integration, and is about two orders of magnitude faster. Initialised to`FALSE`

.- fixpolygons
Logical flag indicating whether the functions

`owin`

and`as.owin`

should repair errors in polygon data. For example, self-intersecting polygons and overlapping polygons will be repaired. The default is`fixpolygons=TRUE`

.- fftw
Logical value indicating whether the two-dimensional Fast Fourier Transform should be computed using the package fftwtools, instead of the

`fft`

function in the stats package. This affects the speed of`density.ppp`

,`density.psp`

,`blur`

`setcov`

and`Smooth.ppp`

.- gpclib
Defunct. This parameter was used to permit or forbid the use of the package gpclib, because of its restricted software licence. This package is no longer needed.

- huge.npoints
The maximum value of

`n`

for which`runif(n)`

will not generate an error (possible errors include failure to allocate sufficient memory, and integer overflow of`n`

). An attempt to generate more than this number of random points triggers a warning from`runifpoint`

and other functions. Defaults to`1e6`

.- image.colfun
Function determining the default colour map for

`plot.im`

. When called with one integer argument`n`

, this function should return a character vector of length`n`

specifying`n`

different colours.- Kcom.remove.zeroes
Logical value, determining whether the algorithm in

`Kcom`

and`Kres`

removes or retains the contributions to the function from pairs of points that are identical. If these are retained then the function has a jump at \(r=0\). Initialised to`TRUE`

.- maxedgewt
Edge correction weights will be trimmed so as not to exceed this value. This applies to the weights computed by

`edge.Trans`

or`edge.Ripley`

and used in`Kest`

and its relatives.- maxmatrix
The maximum permitted size (rows times columns) of matrices generated by spatstat's internal code. Used by

`ppm`

and`predict.ppm`

(for example) to decide when to split a large calculation into blocks. Defaults to`2^24=16777216`

.- monochrome
Logical flag indicating whether graphics should be plotted in grey scale (

`monochrome=TRUE`

) or in colour (`monochrome=FALSE`

, the default).- n.bandwidth
Integer. Number of trial values of smoothing bandwidth to use for cross-validation in

`bw.relrisk`

and similar functions.- ndummy.min
The minimum number of dummy points in a quadrature scheme created by

`default.dummy`

. Either an integer or a pair of integers giving the minimum number of dummy points in the`x`

and`y`

directions respectively.- ngrid.disc
Number of points in the square grid used to compute a discrete approximation to the areas of discs in

`areaLoss`

and`areaGain`

when exact calculation is not available. A single integer.- npixel
Default number of pixels in a binary mask or pixel image. Either an integer, or a pair of integers, giving the number of pixels in the

`x`

and`y`

directions respectively.- nvoxel
Default number of voxels in a 3D image, typically for calculating the distance transform in

`F3est`

. Initialised to 4 megavoxels:`nvoxel = 2^22 = 4194304`

.- par.binary
List of arguments to be passed to the function

`image`

when displaying a binary image mask (in`plot.owin`

or`plot.ppp`

). Typically used to reset the colours of foreground and background.- par.contour
List of arguments controlling contour plots of pixel images by

`contour.im`

.- par.fv
List of arguments controlling the plotting of functions by

`plot.fv`

and its relatives.- par.persp
List of arguments to be passed to the function

`persp`

when displaying a real-valued image, such as the fitted surfaces in`plot.ppm`

.- par.points
List of arguments controlling the plotting of point patterns by

`plot.ppp`

.- par.pp3
List of arguments controlling the plotting of three-dimensional point patterns by

`plot.pp3`

.- print.ppm.SE
Default rule used by

`print.ppm`

to decide whether to calculate and print standard errors of the estimated coefficients of the model. One of the strings`"always"`

,`"never"`

or`"poisson"`

(the latter indicating that standard errors will be calculated only for Poisson models). The default is`"poisson"`

because the calculation for non-Poisson models can take a long time.- progress
Character string determining the style of progress reports printed by

`progressreport`

. Either`"tty"`

,`"tk"`

or`"txtbar"`

. For explanation of these options, see`progressreport`

.- project.fast
Logical. If

`TRUE`

, the algorithm of`project.ppm`

will be accelerated using a shorcut. Initialised to`FALSE`

.- psstA.ngrid
Single integer, controlling the accuracy of the discrete approximation of areas computed in the function

`psstA`

. The area of a disc is approximated by counting points on an \(n \times n\) grid. Initialised to 32.- psstA.nr
Single integer, determining the number of distances \(r\) at which the function

`psstA`

will be evaluated (in the default case where argument`r`

is absent). Initialised to 30.- psstG.remove.zeroes
Logical value, determining whether the algorithm in

`psstG`

removes or retains the contributions to the function from pairs of points that are identical. If these are retained then the function has a jump at \(r=0\). Initialised to`TRUE`

.- rmh.p, rmh.q, rmh.nrep
New default values for the parameters

`p`

,`q`

and`nrep`

in the Metropolis-Hastings simulation algorithm. These override the defaults in`rmhcontrol.default`

.- scalable
Logical flag indicating whether the new code in

`rmh.default`

which makes the results scalable (invariant to change of units) should be used. In order to recover former behaviour (so that previous results can be reproduced) set this option equal to`FALSE`

. See the “Warning” section in the help for`rmh()`

for more detail.- terse
Integer between 0 and 4. The level of terseness (brevity) in printed output from many functions in spatstat. Higher values mean shorter output. A rough guide is the following:

The value of0 Full output 1 Avoid wasteful output 2 Remove space between paragraphs 3 Suppress extras such as standard errors `terse`

is initialised to 0.- transparent
Logical value indicating whether default colour maps are allowed to include semi-transparent colours, where possible. Default is

`TRUE`

. Currently this only affects`plot.ppp`

.- units.paren
The kind of parenthesis which encloses the text that explains a

`unitname`

. This text is seen in the text output of functions like`print.ppp`

and in the graphics generated by`plot.fv`

. The value should be one of the character strings`'('`

,`'['`

,`'{'`

or`''`

. The default is`'('`

.

If no arguments are given, the current values of all parameters are returned, in a list.

If one parameter name is given, the current value of this
parameter is returned (**not** in a list, just the value).

If several parameter names are given, the current values of these parameters are returned, in a list.

If `name=value`

pairs are given, the named parameters
are reset to the given values, and the **previous** values of
these parameters are returned, in a list.

##### Value

Either a list of parameters and their values, or a single value. See Details.

##### Internal parameters

The following parameters may also be specified to
`spatstat.options`

but are intended for
software development or testing purposes.

- allow.logi.influence
Logical. For software development purposes only: prevents spatstat from performing incorrect calculations in cases which are not yet supported. Initialised to

`FALSE`

.- closepairs.newcode
Logical. Whether to use new version of the code for

`closepairs`

. Initialised to`TRUE`

.- crossing.psp.useCall
Logical. Whether to use new version of the code for

`crossing.psp`

. Initialised to`TRUE`

.- crosspairs.newcode
Logical. Whether to use new version of the code for

`crosspairs`

. Initialised to`TRUE`

.- densityC
Logical. Indicates whether to use accelerated C code (

`densityC=TRUE`

) or interpreted R code (`densityC=FALSE`

) to evaluate`density.ppp(X, at="points")`

. Initialised to`TRUE`

.- exactdt.checks.data
Logical. Do not change this value, unless you are Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

- fasteval
One of the strings

`'off'`

,`'on'`

or`'test'`

determining whether to use accelerated C code to evaluate the conditional intensity of a Gibbs model. Initialised to`'on'`

.- old.morpho.psp
Logical. Whether to use old R code for morphological operations. Initialise to

`FALSE`

.- selfcrossing.psp.useCall
Logical. Whether to use new version of the code for

`selfcrossing.psp`

. Initialised to`TRUE`

.- use.Krect
Logical. Whether to use new code for the K-function in a rectangular window. Initialised to

`TRUE`

.

##### See Also

##### Examples

```
# NOT RUN {
# save current values
oldopt <- spatstat.options()
spatstat.options("npixel")
spatstat.options(npixel=150)
spatstat.options(npixel=c(100,200))
spatstat.options(par.binary=list(col=grey(c(0.5,1))))
spatstat.options(par.persp=list(theta=-30,phi=40,d=4))
# see help(persp.default) for other options
# revert
spatstat.options(oldopt)
# }
```

*Documentation reproduced from package spatstat, version 1.49-0, License: GPL (>= 2)*