powered by
This function swaps observations completely random in order to introduce contamination in the data. Used in parameter_tuning.
parameter_tuning
contamination_random(cont, data)
A matrix with switched observations.
numeric, amount of contamination in data.
data whose observations should be switched.
# 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