Learn R Programming

IFC (version 0.2.1)

cpp_cleanse: Matrix Cleanser

Description

Replaces values in matrix mat according to mask msk. Depending of 'add_noise' parameter, values of 'mat' will be replaced with noise or not.

Value

a NumericMatrix cleansed according to 'msk'.

Arguments

mat

a NumericMatrix.

msk

a IntegerMatrix.

add_noise

bool, whether to add normal noise or not, Rcpp::Rf_rnorm(bg, sd) function is used. Default is true.

bg

double, mean value of the background added if 'add_noise' is true. Default is 0.0.

sd

double, standard deviation of the background added if 'add_noise' is true. Default is 0.0.