Skip to content
New issue

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

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

Already on GitHub? # to your account

add_case/add_row silently converts factors to strings #1543

Open
vorpalvorpal opened this issue May 25, 2023 · 0 comments
Open

add_case/add_row silently converts factors to strings #1543

vorpalvorpal opened this issue May 25, 2023 · 0 comments

Comments

@vorpalvorpal
Copy link

If you provide a character vector to a column that is currently a factor add_case changes the column class to character.

tibble(col = fct(NA_character_, levels = c("A", "B"))) |>
    add_case(col = "A")

I feel like this should, at the very least, produce a warning rather than just silently changing the class of the column. Possibly it should even change "A" to to fct("A") with a warning.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant