fm.as.factorR Documentation

FlashR factor vector.

Description

fm.as.factor converts a FlashR vector to a FlashR factor vector.

Usage

fm.as.factor(fm, num.levels = -1)

Arguments

fm

a FlashR vector.

num.levels

The number of levels in the factor vector.

Details

Currently, this function only works for integer input vectors. If the input vector isn't integers, it converts the vector to an integer vector. By default, it uses the maximal value as the number of levels for the factor.

Value

a FlashR factor vector.

Examples

vec <- fm.as.factor(as.integer(fm.runif(100, min=0, max=100)))