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

avoid spurious warnings from forcats #344

Open
maxheld83 opened this issue Dec 2, 2021 · 0 comments
Open

avoid spurious warnings from forcats #344

maxheld83 opened this issue Dec 2, 2021 · 0 comments
Milestone

Comments

@maxheld83
Copy link
Contributor

out <- funder_info %>%
mutate(name = ifelse(is.na(.data$name), "No funding info", .data$name)) %>%
mutate(name = forcats::fct_lump_prop(.data$name, prop = 0.03, other_level = "Other funders")) %>%
mutate(name = forcats::fct_infreq(.data$name)) %>%
mutate(name = forcats::fct_relevel(.data$name, "Other funders", after = Inf)) %>%
mutate(name = forcats::fct_relevel(.data$name, "No funding info", after = Inf))

These relevels cause (spurious) warnings when the levels do not, in fact, exist, which can be the case

@maxheld83 maxheld83 moved this to Todo in max's scrum(ish) Dec 2, 2021
@maxheld83 maxheld83 added this to the Metacheck 2.0 milestone Dec 2, 2021
maxheld83 added a commit that referenced this issue Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant