R/my.cut.r

Defines functions my.cut

my.cut <- function(x, lo = min(x), hi = max(x), n) {
  wi <- (hi - lo)/(n-1)
  lo <- lo - wi/2
  hi <- hi + wi/2
  x <- x[ which(lo <= x & x <= hi) ]
  cut(x, breaks = seq(lo, hi, by = wi), include.lowest = TRUE)
}
HervePerdry/M1SP documentation built on Dec. 16, 2024, 8:19 p.m.