Learn R Programming

hutilscpp (version 0.10.10)

ModeC: Most common element

Description

Most common element

Usage

ModeC(
  x,
  nThread = getOption("hutilscpp.nThread", 1L),
  .range_fmatch = 1000000000,
  option = 1L
)

Arguments

x

An atomic vector.

nThread

Number of threads to use.

.range_fmatch

If the range of x differs by more than this amount, the mode will be calculated via fmatchp.

option

integer(1) Handle exceptional cases:

0

Returns NULL quietly.

1

Returns an error if the mode cannot be calculated.

2

Emits a warning if the mode cannot be calculate, falls back to hutils::Mode

Examples

Run this code
ModeC(c(1L, 1L, 2L))


Run the code above in your browser using DataLab