Mode: get the mode of a dataset

View source: R/toolbox.R

ModeR Documentation

get the mode of a dataset

Description

Computes the most frequently occuring value in a sampling distribution.

Usage

Mode(x, categorical = FALSE)

Arguments

x

a vector

categorical

logical. If TRUE, returns the most frequently occuring value for categorical variables. If FALSE, returns the value corresponding to the maximimum kernel density for continuous variables

Value

a scalar

Examples

data(catchments,package='geostats')
m1 <- Mode(catchments$CaMg,categorical=TRUE)

m2 <- 1:50
for (i in m2){
   m2[i] <- Mode(rnorm(100),categorical=FALSE)
}
hist(m2)

geostats documentation built on Jan. 7, 2023, 5:32 p.m.

Related to Mode in geostats...