Learn R Programming

wrMisc (version 1.15.3.1)

.sortMid: Choose most frequent or middle of sorted vector

Description

This function chooses the (first) most frequent or middle of sorted vector, similar to the concept of mode

Usage

.sortMid(x, retVal = TRUE)

Value

This function returns a numeric verctor

Arguments

x

(numeric) main input

retVal

(logical) return value of most frequent, if FALSE return index of (1st) 'x' for most frequent

See Also

simple/partial functionality in summarizeCols, checkSimValueInSer

Examples

Run this code
.sortMid(11:14)
.sortMid(rep("b",3))

Run the code above in your browser using DataLab