r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
643 stars 56 forks source link

Add pkg_load() for loading and install packages #524

Closed joan-yanqiong closed 11 months ago

joan-yanqiong commented 11 months ago

Similar to the pacman package, use pkg_load() to first try to load the packages and if they're not installed use pkg_install to install the missing packages.

This is my first time contributing to an R package, so I'm not fully sure how this works. Therefore, I just tried to isolate the pkg_load() function and tried it out, it seemed to work. Though any tips are welcome!

gaborcsardi commented 11 months ago

Thanks! Installing and loading a package are two fundamentally different operations, so we are not going to support doing both at once, sorry.