elementWithHighestMode: Element with the hightest number of occurences

Description Usage Arguments Value Author(s) Examples

View source: R/rjmcmcMethodsIntern.R

Description

Returned the integer with the highest number of occurences in a vector. When more than one integer have the highest number of occurences, NA is returned.

Usage

1

Arguments

sample

a numeric vector (of positive integer values). If the elements of sample are numeric but not integer, the elements are truncated by as.integer.

Value

a integer with the highest number of occurences or NA when more than one integer have the highest number of occurences.

Author(s)

Rawane Samb, Astrid Deschenes

Examples

1
2
3
4
5
6
## Return the element with the hightest number of occurence
data01 <- c(1L, 2L, 5L, 10L, 5L, 10L, 5L)
RJMCMC:::elementWithHighestMode(data01)

data02 <- c(3L, 6L, 4L, 3L, 6L)
RJMCMC:::elementWithHighestMode(data02)

ArnaudDroitLab/RJMCMC documentation built on Sept. 13, 2017, 5:48 a.m.