factorize | R Documentation |
Coerce all columns in the object to factor
(i.e. stringsAsFactors
).
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)
object |
Object. |
j |
|
... |
Additional arguments. |
Modified object.
All columns will be coerced to factor
.
Updated 2023-09-20.
Legacy stringsAsFactors
approach for data.frame
import.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.