as.vector.factor(x, mode = "any")
x | a factor object. |
mode |
the result mode. It supports the following:
|
x <- factor(c("R", "G", "B", "R")) as.vector.factor(x, mode = "any") # [1] "R" "G" "B" "R" as.vector.factor(x, mode = "list") # [[1]] # [1] R # Levels: B G R# [[2]] # [1] G # Levels: B G R
# [[3]] # [1] B # Levels: B G R
# [[4]] # [1] R # Levels: B G R
as.vector.factor(x, mode = "integer") # [1] 3 2 1 3 as.vector.factor(x, mode = "double") # [1] 3 2 1 3 as.vector.factor(x, mode = "numeric") # [1] 3 2 1 3 as.vector.factor(x, mode = "complex") # [1] 3+0i 2+0i 1+0i 3+0i as.vector.factor(x, mode = "logical") # [1] NA NA NA NA as.vector.factor(x, mode = "character") # [1] "R" "G" "B" "R" as.vector.factor(x, mode = "expression") # expression(3L, 2L, 1L, 3L) ## Not run: as.vector.factor(x, mode = "foo") ## Error in as.vector(x, mode) : invalid 'mode' argument ## End(Not run)