Last data update: 2014.03.03

R: Internally stored model
RFgetModelR Documentation

Internally stored model

Description

The function returns the stored model

Usage

RFgetModel(register, explicite.natscale, show.call=FALSE)

Arguments

register

0,...,21 or an evaluating function, e.g. RFsimulate. Place where intermediate calculations are stored. See also section Registers in RFoptions.

explicite.natscale

logical. Advanced option. If missing, then the model is returned as stored. If FALSE then any RMnatsc is ignored. If TRUE then any RMnatsc is tried to be combined with leading RMS, or returned as such.

show.call

logical or character. If FALSE then the model is shown as interpreted. If TRUE then the user's input including the calling function is returned. See example below.

If show.call is a character it behaves as which.submodels.

Details

Whereas RFgetModel returns a model that can be re-used by the user, RFgetModelInfo can return detailed information.

Value

stored model is returned in list format.

Note

Put Storing=TRUE, see RFoptions if you like to have (more) internal information in case of failure of an initialisation of a random field simulation.

Author(s)

Martin Schlather, schlather@math.uni-mannheim.de http://ms.math.uni-mannheim.de/de/publications/software

See Also

RFgetModelInfo, RFsimulate

Examples

RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again
model <- RMexp(scale=4, var=2) + RMnugget(var=3) + RMtrend(mean=1)
z <- RFsimulate(model, 1:4)
RFgetModel(show.call=FALSE)
RFgetModel(show.call=TRUE)


Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RandomFields)
Loading required package: sp
Loading required package: RandomFieldsUtils
This is RandomFieldsUtils Version: 0.2.1
This is RandomFields Version: 3.1.16

Attaching package: 'RandomFields'

The following object is masked from 'package:RandomFieldsUtils':

    RFoptions

The following objects are masked from 'package:base':

    abs, acosh, asin, asinh, atan, atan2, atanh, cos, cosh, exp, expm1,
    floor, gamma, lgamma, log, log1p, log2, logb, max, min, round, sin,
    sinh, sqrt, tan, tanh, trunc

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RandomFields/RFgetModel.Rd_%03d_medium.png", width=480, height=480)
> ### Name: RFgetModel
> ### Title: Internally stored model
> ### Aliases: RFgetModel
> ### Keywords: spatial
> 
> ### ** Examples
> 
> RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
> ##                   RFoptions(seed=NA) to make them all random again
> model <- RMexp(scale=4, var=2) + RMnugget(var=3) + RMtrend(mean=1)
> z <- RFsimulate(model, 1:4)
NOTE: simulation is performed with fixed random seed 0.
Set 'RFoptions(seed=NA)' to make the seed arbitrary.
New output format of RFsimulate: S4 object of class 'RFsp';
for a bare, but faster array format use 'RFoptions(spConform=FALSE)'.
> RFgetModel(show.call=FALSE)
 $   : chr "RMplus"
 $ C0:List of 4
  ..$      : chr "RMS"
  ..$ var  : num 2
  ..$ scale: num 4
  ..$ phi  :List of 1
  .. ..$ : chr "RMexp"
 $ C1:List of 3
  ..$    : chr "RMS"
  ..$ var: num 3
  ..$ phi:List of 3
  .. ..$     : chr "RMnugget"
  .. ..$ tol : num 0
  .. ..$ vdim: int 1
 $ C2:List of 2
  ..$     : chr "RMtrend"
  ..$ mean: num 1
> RFgetModel(show.call=TRUE)
 $          : chr "RFsimulate"
 $ checkonly: int 0
 $ setseed  : chr "R object"
 $ env      : chr "R environment"
 $ phi      :List of 4
  ..$   : chr "RMplus"
  ..$ C0:List of 4
  .. ..$      : chr "RMS"
  .. ..$ var  : num 2
  .. ..$ scale: num 4
  .. ..$ phi  :List of 1
  .. .. ..$ : chr "RMexp"
  ..$ C1:List of 3
  .. ..$    : chr "RMS"
  .. ..$ var: num 3
  .. ..$ phi:List of 3
  .. .. ..$     : chr "RMnugget"
  .. .. ..$ tol : num 0
  .. .. ..$ vdim: int 1
  ..$ C2:List of 2
  .. ..$     : chr "RMtrend"
  .. ..$ mean: num 1
> ## Don't show: 
> FinalizeExample()
> ## End(Don't show)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>