fm.as.factor | R Documentation |
fm.as.factor
converts a FlashR vector to a FlashR factor vector.
fm.as.factor(fm, num.levels = -1)
fm |
a FlashR vector. |
num.levels |
The number of levels in the factor vector. |
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.
a FlashR factor vector.
vec <- fm.as.factor(as.integer(fm.runif(100, min=0, max=100)))