Coerce all columns in the object to factor (i.e. stringsAsFactors).

factorize(object, ...)

# S4 method for ANY
factorize(object)

Arguments

object

Object.

...

Additional arguments.

Value

Modified object. All columns will be coerced to factor.

See also

encode() for run-length encoding (Rle) approach.

Examples

df <- S4Vectors::DataFrame(a = letters[seq_len(5L)], b = seq_len(5L)) x <- factorize(df)