Hi team,
I'm wondering how to use renv from the command line? Using Ubuntu 24, the Posit supplied version of R 4.5.1, and renv 1.1.5.
I have a new, empty, directory, with full permissions in my HOME called renv-4.5.1. When in that directory I open R with /opt/R/4.5.1/bin/R -q, and have tried:
renv::init(); restart R;renv::install(x);renv::snapshot(x)renv::init(); restart R;renv::install(x);library(x);renv::snapshot()renv::init(); restart R;install.packages(x);renv::snapshot()renv::init(); restart R;install.packages(x);library(x);renv::snapshot()
In each of the first two cases, I get packages installed into /path/renv/library/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/
In the second two cases I get packages installed into my home-dir R package cache.
In all four cases, when I run renv::snapshot() the output I see is:
- The lockfile is already up to date.
When I quit out of R, and then check the renv.lock file, the only thing I see in it is the renv package. None of the other packages installed are listed.
From what I've read in the documentation, that is not how it is meant to work?
What am I doing wrong in my process? Thanks