-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Labels
featurea feature request or enhancementa feature request or enhancementtidy-dev-day 🤓Tidyverse Developer Day rstd.io/tidy-dev-dayTidyverse Developer Day rstd.io/tidy-dev-day
Description
This is the same issue as #103 with a different request.
It seems as though fct_reorder() and fct_reorder2() should only require that the results of the function are sortable not that they are numeric. Lexicographical order for the below is consistent and well-defined, but a simple numerical mapping can be more complex when the input isn't as simple as the below.
My feature request is: Can fct_reorder() and fct_reorder2() please allow non-numeric values? It seems like it could be as simple as running xtfrm() on the results of .fun.
Related to this, can the documentation be updated to indicate what the return value of .fun() must be?
library(forcats)
fct_reorder(.f=LETTERS[1:3], .x=LETTERS[4:6], .fun=min)
#> Error: `fun` must return a single number per groupCreated on 2018-09-11 by the reprex package (v0.2.0).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementtidy-dev-day 🤓Tidyverse Developer Day rstd.io/tidy-dev-dayTidyverse Developer Day rstd.io/tidy-dev-day