tidyverse / forcats

🐈🐈🐈🐈: tools for working with categorical variables (factors)
https://forcats.tidyverse.org/
Other
553 stars 126 forks source link

documentation for fct_reorder, fct_relevel, fct_recode #269

Closed ahcyip closed 3 years ago

ahcyip commented 4 years ago

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".

image

ahcyip commented 4 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?

hadley commented 3 years ago

I think this is better resolved in RStudio rather than forcats.