moda: Calculating the Mode

Description Usage Arguments Details Value Author(s) Examples

Description

This function calculates the mode of a vector.

Usage

1
moda(x, na.rm = TRUE)

Arguments

x

A numeric vector

na.rm

A Boolean value that indicates the presence of missing values.

Details

The function returns the mode or modes of a vector. If a tie exists, all values that are tied are returned.

Value

moda

A numeric value representing the mode of the vector

Author(s)

Caroline Rodriguez and Edgar Acuna

Examples

1
2
3
#---- Calculating the mode ----
x=c(1,4,2,3,4,6,3,7,8,5,4,3)
moda(x)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
[1] 4 3

dprep documentation built on May 29, 2017, 11:01 a.m.