inst/examples/R/data/univariate/location_coeff/example_location.R

data(Boston, package="MASS")
# mean
mean(Boston$medv)
# median
median(Boston$medv)
# mode, see http://stackoverflow.com/questions/2547402
Mode <- function(x) {
  ux <- unique(x)
  ux[which.max(tabulate(match(x, ux)))]
}
Mode(Boston$rad)
sigbertklinke/shinyExample documentation built on May 26, 2019, 4:32 a.m.