Hmm, slightly off topic to the OP, but related answer:
Microsoft stashes daily snapshots of CRAN. This free service is called MRAN.
You can set an MRAN daily snapshot as a repos option and install.packages() will use that repo when downloading. In this way, you can always download packages from a particular point in time. In your case, you always want the latest, so use Sys.Date() as your day to select.
# MRAN snapshots
base_url <- "http://mran.revolutionanalytics.com/snapshot/"
# download from MRAN on this date
when <- Sys.Date() # or any date as YYYY-MM-DD
# set options
options(repos = list(CRAN = paste0(base_url, when)))
# the repo option set above defines where to download packages from
install.packages("my_package")
This is particularly useful when using Docker to build production-grade R code because you can ensure the packages installed into your image always come from the same, static date. I use something like this:
ARG WHEN
RUN R -e "options(repos = \
list(CRAN = 'http://mran.revolutionanalytics.com/snapshot/${WHEN}')); \
install.packages('my_package')"