Help needed in using the Renv package

Hi all,

I am really new to RENV, and was hoping to get some insights.

library(renv)

setwd(some file path here)
renv::init()

renv::install("tidyverse@1.2.1")
renv::install("modelr@0.1.5")
renv::install("dbplyr@1.4.2")
renv::install("tidyr@1.0.2")
renv::install("broom@0.5.2")
renv::install("dplyr@0.8.5")
renv::install("data.table@1.12.2")
renv::install("lubridate@1.7.4")
renv::install("readxl@1.3.1")
renv::install("stringr@1.4.0")
renv::install("purrr@0.3.2")
renv::install("formattable@0.2.0.1")

#The installation step above took about 2 hours. Anyone has any idea why?

# I then used the snapshot function. My understanding is that this will only capture the packages installed above?

renv::snapshot()

This is most likely because these packages had to be installed from sources, rather than binaries. What operating system are you using?

Please see the renv documentation online:


Thanks for the reply @kevinushey.
I was most probably downloading from the source previously. I have now downloaded the archive packages with .tar.gz format onto my drive.

This is an example of what I have now:

renv::install("some file path/tidyverse_1.2.1.tar.gz", type = "binary")

However, I am still seeing that R console is reading files from mran.microsft, instead of the location that I have specified, so it is still taking a while.

I'm not able to reproduce:

> renv::install("~/Desktop/digest_0.6.24.tar.gz", rebuild = TRUE)
Installing digest [0.6.24] ...
	OK [built from source]

Unless what you're seeing is that renv is installing dependent packages from MRAN. If that's the case, then that's of course expected.

Also note that setting type won't have any action here if you're installing from a local file (since you're already explicitly providing the path to a source tarball or a binary package).