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 would definitely take @dirk-eddelbuettel's advice on this (XY problem), but it is possible if you add this to your .Rprofile:
(This command is run before any packages are loaded so you need to specify the install.packages function comes from utils).
Not sure if this applies to windows; my system info:
N.B. Choose your CRAN mirror accordingly (unless you also happen to be in Australia): https://cran.r-project.org/mirrors.html