Learn R Programming

do (version 2.0.0.1)

columntrans: Change data type

Description

Change data type

Usage

factor.it(x) <- value

factor.it(x, value)

numeric.it(x, value)

numeric.it(x) <- value

Value

factor or numeric columns in a dataframe

Arguments

x

dataframe

value

column names

Examples

Run this code
str(mtcars)
factor.it(mtcars,c("cyl", "vs", "am", "gear"))
factor.it(mtcars)=c("cyl", "vs", "am", "gear")
str(mtcars)

numeric.it(mtcars,c("cyl", "vs", "am", "gear"))
numeric.it(mtcars)=c("cyl", "vs", "am", "gear")
str(mtcars)

Run the code above in your browser using DataLab