threshold | R Documentation |
This function thresholds an array or vector, setting elements below the threshold value to zero. The threshold can be given literally or calculated using k-means clustering.
threshold(x, level, method = c("literal", "kmeans"), binarise = TRUE)
x |
A numeric vector or array. |
level |
The literal threshold level, if required. |
method |
The method to use to calculate the threshold. If
|
binarise |
Whether to set suprathreshold elements to unity (if
|
Jon Clayden <code@clayden.org>
binarise
x <- c(0.1, 0.05, 0.95, 0.85, 0.15, 0.9) threshold(x, method="kmeans") threshold(x, 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.