Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

codes

Integer Codes of Factor Levels


Description

codes returns the integer codes for each factor level from a factor.

Usage

codes(fct)

Arguments

fct

factor.

Value

integer vector with length = length(levels(fct), elements = integer codes of fct and names = levels(fct).

Examples

codes(state.region)
codes(iris$"Species")

str2str

Convert R Objects from One Structure to Another

v0.1.1
GPL (>= 2)
Authors
David Disabato [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.