Learn R Programming

ssMRCD (version 1.1.0)

contamination_random: Contamination Through Swapping

Description

This function swaps observations completely random in order to introduce contamination in the data. Used in parameter_tuning.

Usage

contamination_random(cont, data)

Value

A matrix with switched observations.

Arguments

cont

numeric, amount of contamination in data.

data

data whose observations should be switched.

Examples

Run this code
# set seed
set.seed(1)

# get data
data(weatherAUT2021)

# switch 5% of observations
contamination_random(cont = 0.05, data = weatherAUT2021[,1:6])

Run the code above in your browser using DataLab