accessors: Accessor and mutator functions for objects

Description Usage Arguments Value Methods for function getAdd Methods for functions getAux and setAux Methods for function getCall Methods for functions getCollect and setCollect Methods for function getColnames Methods for function setColnames Methods for functions getContControl and setContControl Methods for function getControl Methods for function getDataControl Methods for function getDesign Methods for function setDesign Methods for functions getDistribution and setDistribution Methods for functions getDots and setDots Methods for function getEpsilon Methods for function setEpsilon Methods for functions getFun and setFun Methods for functions getGrouping and setGrouping Methods for function getIndices Methods for functions getIntoContamination and setIntoContamination Methods for functions getK and setK Methods for function getLegend Methods for functions getNAControl and setNAControl Methods for function getNArate Methods for function setNArate Methods for function getNr Methods for function getNrep Methods for function getProb Methods for function setProb Methods for functions getSAE and setSAE Methods for function getSampleControl Methods for function getSeed Methods for function getSize Methods for function setSize Methods for function getSplit Methods for functions getTarget and setTarget Methods for function getValues Author(s) References Examples

Description

Get values of slots of objects via accessor functions and set values via mutator functions. If no mutator methods are available, the slots of the corresponding objects are not supposed to be changed by the user.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
getAdd(x)

getAux(x)
setAux(x, aux)

getCall(x, ...)

getCollect(x)
setCollect(x, collect)

getColnames(x)
setColnames(x, colnames)

getContControl(x)
setContControl(x, contControl)

getControl(x)

getDataControl(x)

getDesign(x)
setDesign(x, design)

getDistribution(x)
setDistribution(x, distribution)

getDots(x, ...)
setDots(x, dots, ...)

## S4 method for signature 'TwoStageControl'
getDots(x, stage = NULL)
## S4 method for signature 'TwoStageControl'
setDots(x, dots, stage = NULL)

getEpsilon(x)
setEpsilon(x, epsilon)

getFun(x, ...)
setFun(x, fun, ...)

## S4 method for signature 'TwoStageControl'
getFun(x, stage = NULL)
## S4 method for signature 'TwoStageControl'
setFun(x, fun, stage = NULL)

getGrouping(x)
setGrouping(x, grouping)

getIndices(x)

getIntoContamination(x)
setIntoContamination(x, intoContamination)

getK(x)
setK(x, k)

getLegend(x)

getNAControl(x)
setNAControl(x, NAControl)

getNArate(x)
setNArate(x, NArate)

getNr(x)

getNrep(x)

getProb(x, ...)
setProb(x, prob, ...)

## S4 method for signature 'TwoStageControl'
getProb(x, stage = NULL)
## S4 method for signature 'TwoStageControl'
setProb(x, prob, stage = NULL)

getSAE(x)
setSAE(x, SAE)

getSampleControl(x)

getSeed(x)

getSize(x, ...)
setSize(x, size, ...)

## S4 method for signature 'TwoStageControl'
getSize(x, stage = NULL)
## S4 method for signature 'TwoStageControl'
setSize(x, size, stage = NULL)

getSplit(x)

getTarget(x)
setTarget(x, target)

getValues(x)

Arguments

x

an object.

aux

a character string specifying an auxiliary variable (see "ContControl" and "NAControl").

collect

a logical indicating whether groups should be collected after sampling individuals or sampled directly (see "SampleControl").

colnames

a character vector specifying column names (see "DataControl").

contControl

an object of class "ContControl" (see "SimControl").

design

a character vector specifying columns to be used for stratification (see "SampleControl", "TwoStageControl" and "SimControl").

distribution

a function generating data (see "DataControl" and "DCARContControl").

dots

additional arguments to be passed to a function (see "DataControl", "DARContControl", "DCARContControl", "SampleControl", "TwoStageControl" and "SimControl").

epsilon

a numeric vector giving contamination levels (see "VirtualContControl").

fun

a function (see "DARContControl", "SampleControl", "TwoStageControl" and "SimControl").

grouping

a character string specifying a grouping variable (see "ContControl", "NAControl", "SampleControl" and "TwoStageControl").

intoContamination

a logical indicating whether missing values should also be inserted into contaminated observations (see "NAControl").

k

a single positive integer giving the number of samples to be set up (see "VirtualSampleControl").

NAControl

an object of class "NAControl" (see "SimControl").

NArate

a numeric vector or matrix giving missing value rates (see "VirtualNAControl").

prob

a numeric vector giving probability weights (see "SampleControl" and "TwoStageControl").

SAE

a logical indicating whether small area estimation will be used in the simulation experiment (see "SimControl").

size

a non-negative integer or a vector of non-negative integers (see "DataControl", "SampleControl" and "TwoStageControl").

stage

optional integer; for certain slots of "TwoStageControl", this allows to access or modify only the list component for the specified stage. Use 1 for the first stage and 2 for the second stage.

target

a character vector specifying target columns (see "VirtualContControl" and "VirtualNAControl").

...

only used to allow for the stage argument in accessor and mutator methods for "TwoStageControl". Otherwise no additional arguments are available.

Value

For accessor functions, the corresponding slot of x is returned.

For mutator functions, the corresponding slot of x is replaced.

Methods for function getAdd

signature(x = "SimResults")

Methods for functions getAux and setAux

signature(x = "ContControl")
signature(x = "NAControl")

Methods for function getCall

signature(x = "SampleSetup")
signature(x = "SimResults")
signature(x = "Strata")

Methods for functions getCollect and setCollect

signature(x = "SampleControl")

Methods for function getColnames

signature(x = "DataControl")
signature(x = "SimResults")

Methods for function setColnames

signature(x = "DataControl")

Methods for functions getContControl and setContControl

signature(x = "SimControl")

Methods for function getControl

signature(x = "SampleSetup")
signature(x = "SimResults")

Methods for function getDataControl

signature(x = "SimResults")

Methods for function getDesign

signature(x = "SampleControl")
signature(x = "TwoStageControl")
signature(x = "SimControl")
signature(x = "SimResults")
signature(x = "Strata")

Methods for function setDesign

signature(x = "SampleControl")
signature(x = "TwoStageControl")
signature(x = "SimControl")

Methods for functions getDistribution and setDistribution

signature(x = "DataControl")
signature(x = "DCARContControl")

Methods for functions getDots and setDots

signature(x = "DataControl")
signature(x = "DARContControl")
signature(x = "DCARContControl")
signature(x = "SampleControl")
signature(x = "TwoStageControl")
signature(x = "SimControl")

Methods for function getEpsilon

signature(x = "SimResults")
signature(x = "VirtualContControl")

Methods for function setEpsilon

signature(x = "VirtualContControl")

Methods for functions getFun and setFun

signature(x = "DARContControl")
signature(x = "SampleControl")
signature(x = "TwoStageControl")
signature(x = "SimControl")

Methods for functions getGrouping and setGrouping

signature(x = "ContControl")
signature(x = "NAControl")
signature(x = "SampleControl")
signature(x = "TwoStageControl")

Methods for function getIndices

signature(x = "SampleSetup")

Methods for functions getIntoContamination and setIntoContamination

signature(x = "NAControl")

Methods for functions getK and setK

signature(x = "VirtualSampleControl")

Methods for function getLegend

signature(x = "Strata")

Methods for functions getNAControl and setNAControl

signature(x = "SimControl")

Methods for function getNArate

signature(x = "SimResults")
signature(x = "VirtualNAControl")

Methods for function setNArate

signature(x = "VirtualNAControl")

Methods for function getNr

signature(x = "Strata")

Methods for function getNrep

signature(x = "SimResults")

Methods for function getProb

signature(x = "SampleControl")
signature(x = "TwoStageControl")
signature(x = "SampleSetup")

Methods for function setProb

signature(x = "SampleControl")
signature(x = "TwoStageControl")

Methods for functions getSAE and setSAE

signature(x = "SimControl")

Methods for function getSampleControl

signature(x = "SimResults")

Methods for function getSeed

signature(x = "SampleSetup")
signature(x = "SimResults")

Methods for function getSize

signature(x = "DataControl")
signature(x = "SampleControl")
signature(x = "TwoStageControl")
signature(x = "Strata")
signature(x = "SummarySampleSetup")

Methods for function setSize

signature(x = "DataControl")
signature(x = "SampleControl")
signature(x = "TwoStageControl")

Methods for function getSplit

signature(x = "Strata")

Methods for functions getTarget and setTarget

signature(x = "VirtualContControl")
signature(x = "VirtualNAControl")

Methods for function getValues

signature(x = "SimResults")
signature(x = "Strata")

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.

Examples

1
2
3
4
5
nc <- NAControl(NArate = 0.05)
getNArate(nc)

setNArate(nc, c(0.01, 0.03, 0.05, 0.07, 0.09))
getNArate(nc)

simFrame documentation built on Oct. 14, 2021, 5:24 p.m.