Learn R Programming

Kmisc (version 0.5.0)

factor_: Fast Factor Generation

Description

This function generates factors quickly using faster sorting and matching algorithms available in Rcpp.

Usage

factor_(x, levels = NULL)

Arguments

x
An object of atomic type integer, numeric, character or logical.
levels
An optional character vector of levels. Is coerced to the same type as x. By default, we compute the levels as sort(unique(x)).