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

Incorrect handling of force = FALSE when installing multiple packages using p_install #121

Open
r-cheologist opened this issue May 11, 2019 · 3 comments

Comments

@r-cheologist
Copy link

Consider the following:

  1. Pacman isn't present:

     > "pacman" %in% installed.packages()
     [1] FALSE
    
  2. Neither is dplyr:

    > "dplyr" %in% installed.packages()      
    [1] FALSE
    
  3. Install pacman:

    > install.packages("pacman")
    ...
    * installing *source* package ‘pacman’ ...
    * DONE (pacman)
    
  4. Try reinstall using force = FALSE - correctly refuses to install ...

    > pacman::p_install("pacman", force = FALSE)
    Package is already on your system.
    
  5. BUT when including the reinstall in a multiple-package install, it's reinstalled:

    > pacman::p_install(c("pacman", "dplyr"), force = FALSE)
    ...
    * installing *source* package ‘pacman’
    ...
    

I consider this a bug. the vector of names of packages to be installed should be checked against presence first and then the installation action should run using the uninstalled subset.

@trinker
Copy link
Owner

trinker commented May 16, 2019

Thanks for the feedback. We'll look at this.

@seb-mueller
Copy link

Has this issue been resolved? I stopped using pacman a while ago because of this bug but would if give it another go if this is handled correctly now.

@burgerga
Copy link

burgerga commented Jul 7, 2021

Can confirm, also the documentation is outdated, as it still describes character.only being applicable to ... and not to package.

PS I'm looking for a p_load alternative that doesn't load the packages (for use in https://github.com/ropensci/targets), and I was expecting p_install to be just that, but now I need to use something like:

p_load(tidyverse)
c("biglm", "dplyr", "ggplot2", "readr", "targets", "tidyr") %>% 
  walk(p_install, force = F, character.only = T) %>% 
  suppressMessages()

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

4 participants