Learn R Programming

scanstatistics (version 0.1.0)

column_to_int: Replaces a column with integers, its unique and sorted values enumerated.

Description

Takes a data.table and replaces a single column (preferably) containing character or factor values with the enumeration of these values. The enumeration is done according to the unique and sorted values of the original column elements. This function modifies the input table.

Usage

column_to_int(table, colname)

Arguments

table

A data.table.

colname

The name of a column in the table. This column should be of class character or factor.

Value

The input table modified, with the given column replaced by integer values as described.