inst/examples/conditions/R/classify.R

sign_of <- function(x) {
  if (x > 0) "positive" else if (x < 0) "negative" else "zero"
}

clamp <- function(x, lo, hi) {
  if (x < lo) return(lo)
  if (x > hi) return(hi)
  x
}

Try the muttest package in your browser

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

muttest documentation built on May 14, 2026, 5:10 p.m.