File: gethcats.R

package info (click to toggle)
r-cran-sparr 2.3-16-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 884 kB
  • sloc: makefile: 2
file content (6 lines) | stat: -rw-r--r-- 267 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
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])
}