getMode {folda}R Documentation

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)

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.

Value

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


[Package folda version 0.1.0 Index]