corrupt_mat | R Documentation |
corrupt_mat
subjects specified columns of a given data matrix to a given
limit of detection (LOD). Follows a given imputation scheme when imputing values below LOD.
corrupt_mat(mat, cols, limit, fill = "NA")
mat |
The data matrix to be corrupted. |
cols |
The columns in the data matrix to subject to an LOD. |
limit |
The percent of each specified column to put under the LOD.
Ex: if |
fill |
The impute scheme to use for values below LOD. Takes one of the following:
|
The corrupted matrix
fill
"sqrt2"
results in values below the LOD imputed as LOD/sqrt{2}
.
"-1"
results in values below the LOD imputed as -1
.
"mean"
imputes values below the LOD with the mean of those values below the LOD.
"NA"
replaces values below the LOD with NA
missing values.
"status"
is a special option that returns a vector detailing whether or not values are below the given LOD or not.
Note that the LOD is column-specific.
impute
mat <- matrix(rnorm(25), 5, 5) corrupted_mat <- corrupt_mat(mat, cols=1:5, limit=.4, fill="-1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.