tests/match.arg.S

center <- function(x, type = c("mean", "median", "trimmed")) {
       type <- match.arg(type)
       switch(type,
              mean = mean(x),
              median = median(x),
              trimmed = mean(x, trim = .1))
     }
     x <- rcauchy(10)
     center(x, "t")



# Really want to write this as
setClass("CentralMeasure", contains = "EnumValue")

Try the TypeInfo package in your browser

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

TypeInfo documentation built on Nov. 8, 2020, 5:40 p.m.