Description Usage Arguments Value Examples
This convenience function converts all columns of the supplied data frame into a factors. Existing factors can be ignored (default) or set again which would result in losing any special order or labels.
1 | all_factor(dt, refactor = FALSE, ord = FALSE)
|
dt |
A data frame. |
refactor |
A logical scalar value. Do you want it to also work on variables
that are already factors? Default = |
ord |
A logical vector, indicating which columns of dt should be converted to ordered factors. Will be recycled as necessary. |
A copy of the input where all variables except logicals have been converted to factors.
1 | str(all_factor(data.frame(x = c("foo", "bar"), y = c(10, 20))))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.