How can I automate the response to prompt indicating that packages have more recent versions availible in R?

Viewed 17

I use a lot of R packages that can only be installed from GitHub and sometimes I need to pull a build from a specific commit to ensure reproducibility. It gets annoying when packages stop the installation process until a response is made to the prompt. How can I for example automate a response of 2, update only cran packages?

> devtools::install_github("jbisanz/qiime2R@2a3cee1")
Downloading GitHub repo jbisanz/qiime2R@2a3cee1
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All                                   
2: CRAN packages only                    
3: None                                  
4: GenomeInfoDb (1.30.0 -> 1.30.1) [CRAN]
5: S4Vectors    (0.32.3 -> 0.32.4) [CRAN]
6: rhdf5        (2.38.0 -> 2.38.1) [CRAN]

Enter one or more numbers, or an empty line to skip updates:
0 Answers
Related