Description Usage Arguments See Also Examples
Arrange by a Given Column as Double
1 | arrange_dbl(data, col, desc = FALSE, .by_group = FALSE)
|
data |
A dataframe or tibble. |
col |
Target column. |
desc |
Return sorted in descending order? |
.by_group |
If TRUE, will sort first by grouping variable. Applies to grouped data frames only. |
Other arrange functions:
arrange_int()
,
arrange_num()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(tidyverse)
data("mtcars")
# As Numeric
arrange_num(mtcars, col = carb)
arrange_num(mtcars, col = carb, desc = TRUE)
# As Integer
arrange_int(mtcars, col = carb)
# As Double
arrange_dbl(mtcars, col = carb)
# Native class is maintained
mtcars %>%
mutate_all(as.character) %>%
arrange_num(carb)
mtcars %>%
mutate_all(as.character) %>%
arrange_num(carb) %>%
select(carb) %>%
unlist() %>%
class()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.