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

haven::labelled() clashes on dplyr::if_else() with numeric #765

Open
skolenik opened this issue Nov 8, 2024 · 0 comments
Open

haven::labelled() clashes on dplyr::if_else() with numeric #765

skolenik opened this issue Nov 8, 2024 · 0 comments

Comments

@skolenik
Copy link

skolenik commented Nov 8, 2024

I have some code that deals with labeled tagged_na(), and on some occasions this class does not want to play with something as simple as <dbl>, see the screenshot.

The closest I can get to reprex is below although it does not really produce the error I am seeing.

mtcars |> tibble::as_tibble() |> 
   dplyr::mutate(this=haven::labelled(haven::tagged_na("a"), labels=c("A" = haven::tagged_na("a")))) |>
   dplyr::mutate(this=dplyr::if_else(am==1, this, as.numeric(NA)))
> packageVersion("haven")
[1] ‘2.5.4’
> packageVersion("vctrs")
[1] ‘0.6.5’

Image

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