Learn R Programming

folda (version 0.1.0)

getMode: Calculate the Mode of a Factor Variable with Optional Priors

Description

Calculate the Mode of a Factor Variable with Optional Priors

Usage

getMode(v, prior)

Value

The mode of the factor v as a character string. If all values are NA, the function returns NA.

Arguments

v

A factor or vector that can be coerced into a factor. The mode will be calculated from the levels of this factor.

prior

A numeric vector of prior weights for each level of the factor.