View source: R/sampleCompute.R
removeZeros | R Documentation |
Replace all zeros-like values (in [-threshold,+threshold]) by +threshold (if positive values are required) or +/-threshold.
removeZeros(x, threshold = .Machine$double.eps, positive = FALSE)
x |
numeric matrix or data.frame of raw data (points by line). |
threshold |
numeric value; must be positive. |
positive |
boolean: if TRUE, zeros-like values are replaced by +threshold |
removeZeros replaces all zeros-like values (in [-threshold,+threshold])
x numeric matrix or data.frame of raw data (points by line), with no zeros.
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2),
matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2),
matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
tf <- tempfile()
write.table(dat, tf, sep=",", dec=".")
x <- importSample(file.features=tf)
res <- removeZeros(x$features$initial$x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.