Learn R Programming

simFrame (version 0.5.0)

accessors: Accessor and mutator functions for objects

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

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, ...)

## S3 method for class 'TwoStageControl': getDots(x, stage = NULL) ## S3 method for class 'TwoStageControl': setDots(x, dots, stage = NULL)

getEpsilon(x) setEpsilon(x, epsilon)

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

## S3 method for class 'TwoStageControl': getFun(x, stage = NULL) ## S3 method for class '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, ...)

## S3 method for class 'TwoStageControl': getProb(x, stage = NULL) ## S3 method for class 'TwoStageControl': setProb(x, prob, stage = NULL)

getSAE(x) setSAE(x, SAE)

getSampleControl(x)

getSeed(x)

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

## S3 method for class 'TwoStageControl': getSize(x, stage = NULL) ## S3 method for class '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", "
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 "
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 fo
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.

References

Alfons, A., Templ, M. and Filzmoser, P. (2010) An Object-Oriented Framework for Statistical Simulation: The RPackage simFrame. Journal of Statistical Software, 37(3), 1--36. URL http://www.jstatsoft.org/v37/i03/.

Examples

Run this code
nc <- NAControl(NArate = 0.05)
getNArate(nc)

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

Run the code above in your browser using DataLab