sim_lod {pcpr}R Documentation

Simulate limit of detection data

Description

sim_lod() simulates putting the columns of a given matrix D under a limit of detection (LOD) by calculating the given quantile q of each column and corrupting all values < the quantile to NA, returning the newly corrupted matrix, the binary corruption mask, and a vector of column LODs.

Usage

sim_lod(D, q)

Arguments

D

The input data matrix.

q

A double in the range ⁠[0, 1]⁠ specifying the quantile to use in creating the column-wise LODs. Passed as the probs argument to the quantile() function.

Value

A list containing:

See Also

sim_na(), impute_matrix(), sim_data()

Examples

D <- sim_data(5, 5, sigma = 0.8)$D
D
sim_lod(D, q = 0.2)

[Package pcpr version 1.0.0 Index]