Learn R Programming

fastStat (version 1.4)

to.factor: Set Factor Class

Description

Set Factor Class

Usage

to.factor(x, levels)

Arguments

x

the data that you want to set

levels

levels, the first levels is the reference. If the length of levels is 1, no levels will be given to x

Value

factor x

Examples

Run this code
# NOT RUN {
to.factor(mtcars$gear,c(4,3,5))
to.factor(mtcars$gear)
# }

Run the code above in your browser using DataLab