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

Bug with logical subsetting #99

Open
hadley opened this issue Nov 25, 2024 · 2 comments
Open

Bug with logical subsetting #99

hadley opened this issue Nov 25, 2024 · 2 comments

Comments

@hadley
Copy link

hadley commented Nov 25, 2024

str_atp <- c("mAmYmY", "nbAnsAmA", "")
atp_alph <- c("mA", "mY", "nbA", "nsA")

x <- tidysq::alphabet(tidysq::sq(str_atp, alphabet = atp_alph))
x[c(TRUE, TRUE, FALSE, FALSE)]
#> [1] "mA" "mY" NA   NA

Created on 2024-11-25 with reprex v2.1.0

For reasons I don't fully understand this unfortunately breaks testthat::expect_setequal() in the dev version of testthat, but it seems like something you should fix anyway. (Actually what I don't understand is why expect_setequal() ever worked, not why it fails now).

@DominikRafacz
Copy link
Collaborator

Hi, thanks for reaching out.

It seems that this is related to the fact that when we were developing the package, we abused the behavior of set operations for simplicity. Recent R version added more logic to union and setdiff which broke some of the places where we used them explicitly and this has already made us update the package on CRAN recently. However, it seems we need to go over all the places we use set operations in detail.

We will try to do it over the next few days. I hope we will be able to upload to CRAN soon.

@hadley
Copy link
Author

hadley commented Nov 26, 2024

Great, thanks. I'll probably submit testthat to CRAN on Friday, but you'll still have a couple of weeks after that for the CRAN deadline.

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

2 participants