col2factor {metools}R Documentation

Transform defined columns to factor.

Description

col2factor transform columns type to factor.

Usage

col2factor(x, start, end = ncol(x))

Arguments

x

a dataframe

start

number of start column

end

number of last column (default=last)

Value

Return a dataframe with transformed columns.

Examples

v=data.frame(c(3,2,5,6,5,4))
class(v[,1]) #here class is numeric
v=col2factor(v,1)
class(v[,1]) #now class is character


[Package metools version 1.0.0 Index]