Learn R Programming

wrMisc (version 1.2.3)

stableMode: Estimate mode (most frequent value)

Description

Estimate mode (most frequent value); rounding to range of numbers used as number of significant values ('rangeSign') to better estimate continuous data. This function uses the package BBmisc.

Usage

stableMode(
  x,
  histLike = FALSE,
  rangeSign = 1:6,
  nCl = 50,
  callFrom = NULL,
  silent = FALSE
)

Arguments

x

numeric vector

histLike

(logical) if TRUE, will search context dependent, ie like most frequent class of histogram. Using this mode the search will be refined if either 80 percent of values in single class or >50 percent in single

rangeSign

(integer) range of numbers used as number of significant values

nCl

(integer) defines the number of classes used (if 'histLike'=TRUE), very 'critical' parameter, may change results in strong way !! Note: higher values for 'nCl' will finally loose advantage of histLike-type search of mode !

callFrom

(character) allow easier tracking of message(s) produced

silent

(logical) suppress messages

Value

mode value (numeric)

See Also

cut, hist

Examples

Run this code
# NOT RUN {
set.seed(2012); dat <- round(c(rnorm(50),runif(100)),3)
stableMode(dat)
# }

Run the code above in your browser using DataLab