powered by
This function keeps only the K largest values of the vector sorted_vect and sets the others to zero.
sorted_vect
top(x, thresh, sorted_vect)
vector to threshold
threshold
vector x sorted in descending order
This function returns the thresholded vector.
W. Zhu, C. Levy-Leduc, N. Ternes. "A variable selection approach for highly correlated predictors in high-dimensional genomic data". arXiv:2007.10768.
# NOT RUN { x=sample(1:10,10) sorted_vect=sort(x,decreasing=TRUE) thresh=3 top(x,thresh,sorted_vect) # }
Run the code above in your browser using DataLab