autoinst icon indicating copy to clipboard operation
autoinst copied to clipboard

Automatically install packages when they are missing

Autoinst

Build Status lifecycle

Automatically install CRAN or GitHub packages when they are missing.

Simply add the following to your .Rprofile and packages will be automatically installed when they fail to load.

options(error = autoinst::autoinst)

Then missing packages will be automatically installed, so you can then simply re-run the call.

options(error = autoinst::autoinst)
remove.packages("ggplot2");unloadNamespace("ggplot2")
print(ggplot2::qplot(mtcars$mpg, mtcars$wt))