-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
select_if(<logical vector>) #4213
Comments
This comment has been minimized.
This comment has been minimized.
Here is a stripped down version of the problem: library(dplyr, warn.conflicts = FALSE)
ids <- "Sepal.Length"
iris %>%
select_if(!names(.) %in% ids)
#> Error: Can't create call to non-callable object This is not how library(dplyr, warn.conflicts = FALSE)
iris <- head(iris, 3L)
ids <- "Sepal.Length"
iris %>%
select(-ids)
#> Sepal.Width Petal.Length Petal.Width Species
#> 1 3.5 1.4 0.2 setosa
#> 2 3.0 1.4 0.2 setosa
#> 3 3.2 1.3 0.2 setosa
iris %>%
select_at(setdiff(names(.), ids))
#> Sepal.Width Petal.Length Petal.Width Species
#> 1 3.5 1.4 0.2 setosa
#> 2 3.0 1.4 0.2 setosa
#> 3 3.2 1.3 0.2 setosa |
Actually it was on purpose that you could supply logical vectors instead of a predicate, this is following purrr semantics for |
Thanks for looking into this. Any ideas on the Travis CI bit? Or should I ask this somewhere else? |
Here is a thread to address any TracisCI related fixes: https://travis-ci.community/t/travis-build-ignoring-r-package-version-in-description/2431 |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Hello all!
😃
🌑 Intro
During a recent Pull Request (vallenderlab/MicrobiomeR#79), I discovered that our TravisCI build was breaking for some reason. After a few hours of testing code, I still couldn't figure it out. So I created a new PR to test the travis build (See vallenderlab/MicrobiomeR#82 for our process of elimination).
🌓 Troubleshooting Workflow
Via vallenderlab/MicrobiomeR#82 and the same local error that @sdhutchins was having, we discovered that the problem was with
dplyr::select_if
:Here are the Travis builds:
Original branch - https://travis-ci.com/vallenderlab/MicrobiomeR/builds/101668726
Debugging branch - https://travis-ci.com/vallenderlab/MicrobiomeR/builds/101679286
Here is the code in context:
https://github.com/vallenderlab/MicrobiomeR/blob/91eb2c1b9bf124b01cdc662722f484f2665b92cf/R/utils.R#L330-L351
Because the code was running on my local machine and not @sdhutchins computer and the travis servers, we had the chance to compare our libraries. vallenderlab/MicrobiomeR#82 has the session info for mine and @sdhutchins local machines. I copied the dependencies from a previously successful travis build and the current breaking build and found the following differences:
It seems that dplyr updated recently, and that's what was breaking our code.
🌕 Solution
We started to both begin messing with our DESCRIPTION file along with our .travis.yml file. We tried to set dplyr's version to 0.7.8, but the travis build "force" installed the newest version (0.8.0.1) regardless..
So after some digging I changed the travis config file by adding the lines:
This seems to fix the builds but only for:
🌗 Other Issues
The other R version builds:
will fail because they are newly added and I'm assuming it has something to do with the package cache on travisCI. They fail because devtools is not installed.
Additionally it might have something to do with the recent purrr update as well? I'm not sure.
Any help here would be appreciated. I'm not sure if we're doing something wrong in our code, or if we should change something in our Travis build so that it doesnt force install dplyr 0.8.0.1. The current fix doesn't seem like a very good long term solution.
dplyr - @romainfrancois @hadley
purrr/devtools - @lionel @jennybc @jimhester
Sorry to tag so many, but I thought one of you would at least be able to help us. We speant ~7.5 hours yesterday trying to troubleshoot the problem ourselves and got to a good point. But we are still uncomfortable merging our PR. vallenderlab/MicrobiomeR#79
Cheers,
@grabear
The text was updated successfully, but these errors were encountered: