DataControl-class {simFrame} | R Documentation |
Class "DataControl"
Description
Class for controlling model-based generation of data.
Objects from the Class
Objects can be created by calls of the form new("DataControl", ...)
or
DataControl(...)
.
Slots
size
:Object of class
"numeric"
giving the number of observations to be generated.distribution
:Object of class
"function"
generating the data, e.g.,rnorm
(the default) orrmvnorm
from package mvtnorm. It should take a positive integer as its first argument, giving the number of observations to be generated, and return an object that can be coerced to adata.frame
.dots
:Object of class
"list"
containing additional arguments to be passed todistribution
.colnames
:Object of class
"OptCharacter"
; a character vector to be used as column names for the generateddata.frame
, orNULL
.
Extends
Class "VirtualDataControl"
, directly.
Class "OptDataControl"
, by class "VirtualDataControl", distance 2.
Accessor and mutator methods
getSize
signature(x = "DataControl")
: get slotsize
.setSize
signature(x = "DataControl")
: set slotsize
.getDistribution
signature(x = "DataControl")
: get slotdistribution
.setDistribution
signature(x = "DataControl")
: set slotdistribution
.getDots
signature(x = "DataControl")
: get slotdots
.setDots
signature(x = "DataControl")
: set slotdots
.getColnames
signature(x = "DataControl")
: get slotcolnames
.setColnames
signature(x = "DataControl")
: set slotcolnames
.
Methods
In addition to the methods inherited from
"VirtualDataControl"
, the following are available:
generate
signature(control = "DataControl")
: generate data.show
signature(object = "DataControl")
: print the object on the R console.
UML class diagram
A slightly simplified UML class diagram of the framework can be found in
Figure 1 of the package vignette An Object-Oriented Framework for
Statistical Simulation: The R Package simFrame
. Use
vignette("simFrame-intro")
to view this vignette.
Author(s)
Andreas Alfons
References
Alfons, A., Templ, M. and Filzmoser, P. (2010) An Object-Oriented Framework for Statistical Simulation: The R Package simFrame. Journal of Statistical Software, 37(3), 1–36. doi: 10.18637/jss.v037.i03.
See Also
"VirtualDataControl"
, generate
Examples
dc <- DataControl(size = 10, distribution = rnorm,
dots = list(mean = 0, sd = 2))
generate(dc)