Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

top

Thresholding to zero of the smallest values


Description

This function keeps only the K largest values of the vector sorted_vect and sets the others to zero.

Usage

top(x, thresh, sorted_vect)

Arguments

x

vector to threshold

thresh

threshold

sorted_vect

vector x sorted in descending order

Value

This function returns the thresholded vector.

Author(s)

Wencan Zhu [aut, cre], Celine Levy-Leduc [ctb], Nils Ternes [ctb]

References

W. Zhu, C. Levy-Leduc, N. Ternes. "A variable selection approach for highly correlated predictors in high-dimensional genomic data". arXiv:2007.10768.

Examples

x=sample(1:10,10)
sorted_vect=sort(x,decreasing=TRUE)
thresh=3
top(x,thresh,sorted_vect)

WLasso

Variable Selection for Highly Correlated Predictors

v1.0
GPL-2
Authors
Wencan Zhu [aut, cre], Celine Levy-Leduc [ctb], Nils Ternes [ctb]
Initial release
2020-08-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.