colClasses: Coerces data.frame columns to the specified classes

colClassesR Documentation

Coerces data.frame columns to the specified classes

Description

Coerces data.frame columns to the specified classes

Usage

  colClasses(d, colClasses)

Arguments

d

A data.frame.

colClasses

A vector of column attributes, one of: numeric, factor, character, etc.

Examples

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")))

ropensci/sandbox documentation built on May 18, 2022, 7:32 p.m.