Learn R Programming

simFrame (version 0.1.2)

ContControl: Create contamination control objects

Description

Create objects of a class inheriting from "ContControl".

Usage

ContControl(..., type = c("DCAR", "DAR"))

Arguments

...
arguments passed to new("DCARContControl", ...) or new("DARContControl", ...), as determined by type.
type
a character string specifying whether a control object of class "DCARContControl" or "DARContControl" should be created.

Value

  • If type = "DCAR", an object of class "DCARContControl".

    If type = "DAR", an object of class "DARContControl".

See Also

DCARContControl, DARContControl, ContControl

Examples

Run this code
## distributed completely at random
data(eusilc)
sam <- draw(eusilc[, c("id", "eqIncome")], size = 20)
dcarc <- ContControl(target = "eqIncome", epsilon = 0.05, 
    dots = list(mean = 5e+05, sd = 10000), type = "DCAR")
contaminate(sam, dcarc)

## distributed at random
require(MASS)
mu <- rep(0, 2)
Sigma <- matrix(c(1, 0.5, 0.5, 1), 2, 2)
foo <- generate(size = 10, distribution = mvrnorm, 
    dots = list(mu = mu, Sigma = Sigma))
darc <- ContControl(target = "V2", epsilon = 0.2, 
    fun = function(x) x * 100, type = "DAR")
contaminate(foo, darc)

Run the code above in your browser using DataLab