Given an index of columns, convert identified columns of data.frame to factor, ordered factor, or integer. A number of datasets are distributed with an accompanying index of this sort, especially to define which variables should be treated as categorical (here, factors) for predicting modeling. This functions aims to make data type conversions in those cases easier.
typeset(x, factor.index = NULL, orderedfactor.index = NULL,
integer.index = NULL)
data frame: input whose columns' types you want to edit
Integer, vector: Index of columns to be converted to factors using factor(x)
Integer, vector: Index of columns to be converted to ordered factors
using factor(x, ordered = TRUE)
Integer, vector: Index of columns to be converted to integers using as.integer