installing tidyquant using Rprofile

I want to install additional packages besides the default ones every time I restart my R Session.

I have tried this:

options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os))) install.packages(c( 'shinydashboard', 'shinyWidgets', 'rlist', 'sortable', 'tidyverse', 'XML', 'DescTools', 'plotly', 'leaflet', 'tidyquant', 'umap' ))

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.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.