Description Usage Arguments Details Value Examples
View source: R/order_by_content.R
Order the factor by the numbers used in the factor. This function orders on symbolic numbers: 1, 2, 3 etc.
1 | order_by_number(factor, desc = FALSE)
|
factor |
The factor you want to order |
desc |
Set to TRUE to order descending. |
Numbers present in the factor levels will be extracted and used to order the factor. If more than one continuous number is present in the factor level then the first number will be used for numbering.
Ties between two different factor levels are ordered arbitrarily.
Factor levels without numbers are ordered lowest arbitrarily.
an ordered factor
1 2 3 4 5 | f <- c('group_1', 'group_2', 'group_3')
order_by_number(f)
factor <- c('a_3', 'a_3', 'a_1', 'a', 'b')
order_by_number(factor)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.