numericfy: Converts factor or character column of data frame to integer.

View source: R/utils.R

numericfyR Documentation

Converts factor or character column of data frame to integer.

Description

Replaces a specified column, which may contain factor or character variables, with uniquely-numbered integer values. Returns the new data frame and a data frame showing which factor corresponds to which integer, in a list.

Usage

numericfy(dat, column = 1, add = FALSE)

Arguments

dat

A data frame

column

The column number or name of the column to be converted.

add

If TRUE a new column is added, named ‘num<column>’, where '<column>' is the value of the column argument, else the old column is overwritten.


david-borchers/hmltm documentation built on Oct. 29, 2023, 9:07 p.m.