Mode {geostats}R 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)

[Package geostats version 1.6 Index]