For security reasons, we have created our own mini CRAN repository. I would like to prevent R packages from being installed from any location other than our repository, whether this is from a tar file on their desktop or an actual CRAN repository. We have set
local({r <- getOption("repos")
r["CRAN"] <- "http://fakecran.com/R/cran/"
options(repos=r)})
in the RProfile.site
. However, the problem is that they can still change getOption("repos")
to whatever they want and they can also specify a location using install.packages(repos="http://cran.r-project.org")
. Is there any way to override these methods in RProfile.site
(which our users are unable to access)in such a way that they can't then be overridden again?