cat_to_integers: Encode category names to integers

View source: R/helper_categorical.R

cat_to_integersR Documentation

Encode category names to integers

Description

For a category variable with k categories, rename the category names to 1,2,...,k in the order of appearance.

Usage

cat_to_integers(x)

Arguments

x

samples of a categorical variable

Value

A list containing

x

Integer encoded x

xlevels

Original category names corresponding to 1,2,...,k.


udellgroup/mixedgcImp documentation built on Jan. 25, 2023, 7:55 p.m.