factorize: Factorize

factorizeR Documentation

Factorize

Description

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

Usage

factorize(object, ...)

## S4 method for signature 'DFrame'
factorize(object, j = NULL)

## S4 method for signature 'atomic'
factorize(object)

## S4 method for signature 'data.frame'
factorize(object, j = NULL)

## S4 method for signature 'factor'
factorize(object)

Arguments

object

Object.

j

vector. Column names or positions to evaluate.

...

Additional arguments.

Value

Modified object. All columns will be coerced to factor.

Note

Updated 2023-09-20.

See Also

  • Legacy stringsAsFactors approach for data.frame import.

Examples

## DFrame ====
object <- S4Vectors::DataFrame(
    "a" = c("a", "b", "c", "d"),
    "b" = c("a", "a", "b", "b"),
    "c" = c(1L, 2L, 3L, 4L),
    "d" = c(1L, 2L, 1L, 2L),
    "e" = c(TRUE, TRUE, FALSE, FALSE),
    row.names = c("A", "B", "C", "D")
)
object <- factorize(object)
print(object)

acidgenomics/pipette documentation built on Jan. 31, 2024, 10:32 p.m.