Learn R Programming

rENA (version 0.3.0)

reclassify: Reclassify specified columns in a data.table

Description

This function reclassifies specified columns of a data.table using a provided function.

Usage

reclassify(x, v, ...)

Value

The modified data.table with specified columns reclassified.

Arguments

x

A data.table. The data.table containing the columns to be reclassified.

v

A function. The function to apply to each specified column for reclassification.

...

Additional arguments specifying the names of the columns to be reclassified.

Examples

Run this code
library(data.table)
dt <- data.table(a = 1:5, b = 6:10)
dt <- reclassify(dt, as.qe.code, "a", "b")

Run the code above in your browser using DataLab