And this:
options(defaultPackages = c(getOption("defaultPackages"), "tidyquant", ...))
neither of which works. If all I want to do is to install the tidyquant package upon the R Session restart, how do I get it to work inside the Rprofile file? I am working in a corporate environment so that nightly all R Sessions are restarted. Therefore I have to use install.packages("tidyquant")
I recommend you use renv for your package management requirement; if you have permament filespace in your corporate filesystem, you can create a renv cache and then it will be much faster for you to repopulate commonly used packages.
p.s. if an R session is merely restarted while this does mean that packages might need to be reloaded (using library() or require, they dont generally need to be reinstalled, as packages get installed into a users .libpath, so is there something exotic happening on your corporate environment with that ?
I'm thinking that using renv::isolate() to create an independent copy of the library per project could be even better if daily installation is actually needed.