lvl_number: Return the numeric position of a level in a factor variable

View source: R/lvl_number.R

lvl_numberR Documentation

Return the numeric position of a level in a factor variable

Description

Return the numeric position of a level in a factor variable

Usage

lvl_number(f, lvl)

Arguments

f

A factor variable

lvl

The level for which the underlying value is returned

Value

The numeric position of the level

Examples


lvl_number(iris$Species, "versicolor")

philstraforelli/forcatsmisc documentation built on July 4, 2023, 9:52 a.m.