R/top.R

Defines functions top

Documented in top

top <-
function(vect, thresh){
  sorted_vect <- sort(abs(vect),decreasing=TRUE)
  v=sorted_vect[thresh]
  ifelse(abs(vect)>=v,vect,0)
}

Try the PPLasso package in your browser

Any scripts or data that you put into this service are public.

PPLasso documentation built on March 7, 2023, 6:33 p.m.