Closed ahcyip closed 3 years ago
Related issues: fct_reorder is "Reorder factor levels by sorting along another variable" but fct_relevel says it's "Reorder factor levels by hand" - the names don't seem very intuitive and have potential to confuse. And then there's fct_recode "Change factor levels by hand" - how is this different from reordering? fct_relabel says "Automatically relabel factor levels" - what does it mean to "automatically" do it? I think it means according to a function?
I think this is better resolved in RStudio rather than forcats.
RStudio's autocomplete help tooltip/popup doesn't display the first line of the documentation (the title?). Instead, it only shows the "Usage" section and then the "Description" section. So what shows up for fct_reorder is confusing and not very useful/helpful - see screenshot below.
I believe the popup should include the title "Reorder factor levels by sorting along another variable" before showing the Usage "fct_reorder(.f, .x, .fun = median, ..., .desc = FALSE)" and Description "fct_reorder() is useful for 1d displays where ..."
fct_relevel documentation suffers from the same issue.
So perhaps the documentation of fct_reorder and fct_relevel should be modified so that the key info is not only in the 1st line title, but also in what shows up in "Description".