Learn R Programming

SPOTMisc (version 1.19.52)

int2fact: Helper function: transform integer to factor

Description

This function re-codes a factor with pre-specified factor levels, using an integer encoding as input.

Usage

int2fact(x, lvls)

Value

the same factor, now coded with the original levels

Arguments

x

an integer vector (that represents factor vector) to be transformed

lvls

the original factor levels used