Thresholding to zero of the smallest values
This function keeps only the K largest values of the vector sorted_vect and sets the others to zero.
top(x, thresh, sorted_vect)
x |
vector to threshold |
thresh |
threshold |
sorted_vect |
vector x sorted in descending order |
This function returns the thresholded vector.
Wencan Zhu [aut, cre], Celine Levy-Leduc [ctb], Nils Ternes [ctb]
W. Zhu, C. Levy-Leduc, N. Ternes. "A variable selection approach for highly correlated predictors in high-dimensional genomic data". arXiv:2007.10768.
x=sample(1:10,10) sorted_vect=sort(x,decreasing=TRUE) thresh=3 top(x,thresh,sorted_vect)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.