Closed RaoOfPhysics closed 6 years ago
Hi, sorry about the turn-around on this one. librarian 1.2.0 adds three new arguments to unshelf()
to address this:
also_depends
, which detaches dependencies of packages named in ...
safe
, which does not detach packages if they are needed by other still-attached onesquiet
, which suppresses a message created by safe
stopping a detachment.> shelf(tidyverse, janitor) # Janitor needs dplyr and purrr
-- Attaching packages --------------------------------------- tidyverse 1.2.1 --
v ggplot2 2.2.1 v purrr 0.2.4
v tibble 1.4.2 v dplyr 0.7.5
v tidyr 0.8.1 v stringr 1.3.1
v readr 1.1.1 v forcats 0.3.0
-- Conflicts ------------------------------------------ tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
> .Last.value
tidyverse janitor
TRUE TRUE
> librarian:::check_attached()
[1] "janitor" "forcats" "stringr" "dplyr" "purrr" "readr" "tidyr" "tibble"
[9] "ggplot2" "tidyverse" "librarian" "stats" "graphics" "grDevices" "utils" "datasets"
[17] "methods" "base"
> unshelf(tidyverse, also_depends = TRUE, safe = TRUE, quiet = FALSE)
Some packages were not detached because other packages still need them:
dplyr purrr tidyr
To force them to detach, use the 'safe = FALSE' argument.
> librarian:::check_attached()
[1] "janitor" "dplyr" "purrr" "tidyr" "librarian" "stats" "graphics" "grDevices"
[9] "utils" "datasets" "methods" "base"
> unshelf(tidyverse, also_depends = TRUE, safe = FALSE, quiet = FALSE)
> librarian:::check_attached()
[1] "janitor" "librarian" "stats" "graphics" "grDevices" "utils" "datasets" "methods"
[9] "base"
Firstly, thanks for the nice package!
I wanted to ask if it's possible for
unshelf()
to catch all the packages attached via, say,tidyverse
.shelf()
:shelf()
:unshelf()
--here
gets removed but the rest stay: