R/gethcats.R

Defines functions gethcats

Documented in gethcats

gethcats <- function(h,breaks=NULL,step=0.05){
  if(is.null(breaks)) breaks <- unique(as.numeric(quantile(h,seq(0,1,step))))
  hc <- as.numeric(cut(h,breaks=breaks,include.lowest=TRUE,right=TRUE))
  hcen <- breaks[-length(breaks)]+diff(breaks)/2
  return(hcen[hc])
}

Try the sparr package in your browser

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

sparr documentation built on March 31, 2023, 8:40 p.m.