cast: Cast column types in data.table

Description Usage Arguments Examples

View source: R/utils.R

Description

Function to change a column type for data.table columns.

Usage

1
cast(x, fun, cols)

Arguments

x

data.table

fun

type function (e.g. as.integer)

cols

character vector with columns to convert

Examples

1
2
3
4
5
6
## Not run: 
library(data.table)
dt <- data.table(mtcars)
cast(dt, as.character, c('vs', 'cyl'))

## End(Not run)

reinholdsson/rkolada documentation built on Sept. 5, 2019, 6:12 p.m.