Questions tagged [renv]
129 questions
15
votes
3 answers
Rscript to use renv environment
How do I execute a command using RScript myfile.R so that it uses the renv environment of the project/directory it's in, NOT my default environment?

dvanic
- 545
- 1
- 4
- 17
11
votes
1 answer
Can renv be used to create a virtual environment with a specific version of R?
I recently installed R 4.0, after previously using relying R 3.6.3. To manage R repositories, I use Rstudio (currently 1.2.5042 on a Windows 10 machine). After upgrading to R 4.0, I opened a project from a few months ago, and realized that Rstudio…

Matt
- 238
- 1
- 8
9
votes
1 answer
How to use renv package in shiny app to avoid installing new packages on shiny server?
I wanted to test renv package for shiny app.
here is my dummy app :
library(pool)
library(fresh)
library(shiny)
ui <- fluidPage(
titlePanel("Old Faithful Geyser Data"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
…

Haribo
- 2,071
- 17
- 37
7
votes
0 answers
Unable to install packages via renv::restore() ("R was unable to find one or more FORTRAN libraries during compilation.")
I've downloaded an old repo on a new laptop (running on MacOS Catalina) and attempted to run a R script.
The repo has a renv lock file - meaning, I should be able to restore all dependencies as they were.
But as I run the renv::restore() command,…

abtinsr
- 71
- 2
5
votes
1 answer
renv and git: what to commit
I am trying to get me and my colleagues started on using renv. I have found different pieces of information of what should/can be committed to git for collaboration:
the renv collaboration vignette suggests to not only commit the renv.lock, but…

gira
- 175
- 6
5
votes
1 answer
renv::restore() error: failed to retrieve 'package' (using private package)
I am intending to use the renv package in R to set up a global cache on a linux server, where other users would be able to: i) use the packages by creating symlinks to the renv library I created (and therefore save on memory and time by not…

M M
- 429
- 5
- 13
5
votes
1 answer
How to update the version of R used within a project, using renv
I have a project that used R 3.6, I have upgraded R to 4.0.2 and would like to use 4.0.2 for this project. I'm wondering how to go about doing so, or should I completely delete renv/ and rebuild?
Edit
I have done the following:
> renv::init()
This…

baxx
- 3,956
- 6
- 37
- 75
5
votes
2 answers
How to completely remove renv from an R statistics program
I have been using renv on a R project, but now want to remove it from renv versioning, i.e. delete all renv associated files, but still have access to the libraries that I used installed under renv. How do I do this? Alternatively, how do I migrate…

Obromios
- 15,408
- 15
- 72
- 127
5
votes
1 answer
Error installing packages using renv::restore()
I have a problem using renv. For a larger project we want to use renv to all have the same version of r and all our packages. Yet, as soon as a newer version of a package is available and we run renv::restore() we get an error like the following…

Lizzie
- 97
- 1
- 8
5
votes
1 answer
How to maintain R (renv) project
My colleagues and I are working on a book with Bookdown in RStudio. Since I create a lot of graphics with ggplot and therefore I have many dependencies to other packages (ggplot, ggforce, gganimate, ...), I added renv in the course of the book to…

ralph
- 73
- 8
4
votes
3 answers
Why do I need to install the same packages using renv, after having run pkgload::load_all()?
Each time I run pkgload::load_all(), I get the message below.
> pkgload::load_all()
ℹ Loading my_package
ℹ The packages "dm" and "sf" are required.
✖ Would you like to install them?
1: Yes
2: No
After each restart of RStudio, I need to reinstall…

layal
- 180
- 11
4
votes
1 answer
How can I deal with self-written R-packages when using Renv?
In our team, we are sharing self-written functions (e.g. for connecting to our dbs) via a self-written package that I set up in a git-repository (non-public).
As a general rule, we avoid to install packages in our users' accounts. Instead we use…

evilolive
- 407
- 1
- 5
- 12
4
votes
0 answers
installing packages with renv
I open RStudio and type
install.packages('rJava')
and it works fine.
Then I load package which has renv initialized and try the same command and it returns:
Error: package 'rJava' is not available
In addition: Warning messages:
1: curl: (35)…

user1700890
- 7,144
- 18
- 87
- 183
4
votes
0 answers
How do I make Poetry-based Jupyter use IRkernel installed using renv?
I have the following project layout:
. my-project
|- pyproject.toml
|- poetry.lock
|- .jupyter
| '- jupyter_notebook_config.py
|- kernels
| '- R-renv
| '- kernel.json
|- .renv
|- renv.lock
|- .Rprofile
'- # other stuff
IRkernel is installed…

typesanitizer
- 2,505
- 1
- 20
- 44
4
votes
2 answers
R install package stringi in renv
I am trying to install the package stringi with renv::install().
Normally, I would use
install.packages('stringi', configure.vars='ICUDT_DIR=path/to/icudt61l.zip/')
To specify the location of icudt61l.zip dependency.
How can I do this in renv ?
I…

gdevaux
- 2,308
- 2
- 10
- 19