| factor | R Documentation |
The function factor is used to encode a vector as a factor.
factor(
x = character(),
levels,
labels = levels,
exclude = NA,
ordered = is.ordered(x),
nmax = NA
)
ordered(x = character(), ...)
x |
a vector of data, usually taking a small number of distinct values. |
levels |
an optional vector of the unique values (as character strings)
that |
labels |
either an optional character vector of
labels for the levels (in the same order as |
exclude |
a vector of values to be excluded when forming the
set of levels. This may be factor with the same level set as |
ordered |
logical flag to determine if the levels should be regarded as ordered (in the order given). |
nmax |
an upper bound on the number of levels. |
... |
(in |
An object of class "factor" or "ordered".
factor
x <- as.integer64(c(132724613L, -2143220989L, -1L, NA, 1L))
factor(x)
ordered(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.