spocc (version 0.1.2)

spocc_colClasses: Coerces data.frame columns to the specified classes

Description

Coerces data.frame columns to the specified classes

Usage

spocc_colClasses(d, colClasses)

Arguments

d
A data.frame.
colClasses
A vector of column attributes, one of: numeric, factor, character, etc.

Examples

Run this code
dat <- data.frame(xvar = seq(1:10), yvar = rep(c('a','b'),5)) # make a data.frame
str(dat)
str(colClasses(dat, c('factor','factor')))

Run the code above in your browser using DataCamp Workspace