Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Support forcats 1.0.0 #191

Open
2 of 3 tasks
pwwang opened this issue Sep 4, 2023 · 0 comments
Open
2 of 3 tasks

[ENH] Support forcats 1.0.0 #191

pwwang opened this issue Sep 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@pwwang
Copy link
Owner

pwwang commented Sep 4, 2023

Feature Type

  • Adding new functionality to datar

  • Changing existing functionality in datar

  • Removing existing functionality in datar

Problem Description

Feature Description

  • New fct() which works like factor() but errors if values of x
    are not included in the levels specification

  • first2() and last2() now ignore missing values in both x and y

  • add fct_na_value_to_level()

  • fct_explicit_na() is deprecated in favour of fct_na_value_to_level()

  • fct_expand() gains an after argument so that you can choose where
    the new levels are placed

  • fct_infreq() gains the ability to weight by another variable using the w
    argument

  • fct_inorder() now works when not all levels appear in the data

  • fct_lump_prop() and friends now work correctly if you supply weights
    and have empty levels

  • fct_lump_n() and fct_lump_prop() will now create an "Other" level even
    if it only consists of a single level. This makes them consistent with the
    other fct_lump_* functions

  • fct_other() no longer generates a warning if no levels are replaced with
    other

  • fct_relevel(), fct_cross(), and fct_expand() now error if you name the
    arguments in **kwargs since those names are ignored and your code probably
    doesn't do what you think it does (see also fct_relevel() should gain fct_recode() functionality tidyverse/forcats#319).

  • fct_reorder() and fct_reorder2() now remove NA values in _x with a
    warning. You can suppress the warning by setting _na_rm = True (see also fct_reorder() yields unexpected result in presence of missing values tidyverse/forcats#315).

  • fct_reorder() and fct_reorder2() gain a new _default argument that
    controls the placement of empty levels (including levels that might become
    empty after removing missing values in _x) (see also fct_reorder() needs na_last argument tidyverse/forcats#266).

  • fct_unique() now captures implicit missing values if present

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant