{renv}: renv::restore()... not installing several packages -- why?

Hi, all!

I am trying to finally use {renv} after hearing multiple presentations on it. I'm convinced that I should be using it -- but despite the fact that it is supposed to be pretty straightforward, and there is so much documentation on it, I'm stuck on my first attempt.

It seems that only ~1/3 of the packages successfully installed from the lockfile, and I do not understand why.

Situation: I see a project on GitHub that I'd like to explore, and the project has this description:

  1. Set up the project library by calling renv::restore(). This installs the packages necessary for running the app. For more information about renv see Collaborating with renv • renv.
  1. Launch the app using shiny::runApp().

My steps:

  1. Log on to Posit.Cloud. "New Project from Git Repo". Paste in the git from the above url. This works great -- I see all of the files, including the renv.lock file.
  2. run renv::restore() per instructions, and hit "y" to proceed.
  3. I get 3 warnings and 1 error:
Warning: failed to find source for 'class 7.3-20' in package repositories
Error: failed to retrieve package 'class@7.3-20'
In addition: Warning messages:
1: could not retrieve available packages for url '/src/contrib' 
2: In exists(repo, envir = `_renv_repos_archive`) : invalid first argument
  1. I proceed anyway (not fully understanding the above messages, and under the assumption that only {class} failed to install
> shiny::runApp()
Error in loadNamespace(x) : there is no package called ‘shiny’

My confusion:
Why is there no {shiny} and yet I don't see which warning would have told me about that? {shiny} was definitely in the renv.lock file, as evidenced from the (trimmed) output from my renv::restore():

> renv::restore()
The following package(s) will be updated:

# CRAN ===============================
- KernSmooth          [2.23-21 -> 2.23-20]
- MASS                [7.3-60 -> 7.3-57]
- ...
- sf                  [* -> 1.0-7]
- shiny               [* -> 1.7.1]
- shinydashboard      [* -> 0.7.2]
- shinyjs             [* -> 2.1.0]
- sourcetools         [* -> 0.1.7]
- sp                  [* -> 1.5-0]

My diagnostics include:

  1. A very long list of package(s) that are "no longer used in this project". How is this assessment made? I agree that these libraries are potentially not used directly via library() call, but eg, {dplyr} is called directly by code (in global.R), and {dplyr} imports {rlang} -- so why is {rlang} listed as "no longer used"? I thought perhaps that this had to do with a loaded version of {rlang} (since it is so fundamental) being different from the renv.lock version of {rlang} -- but the renv.lock version is 1.0.3 (as you can see here) so I don't know why that would be deemed "no longer used"

trimmed output:

# Status =============================
The following package(s) are no longer used in this project:
                    _
  DBI                 [1.1.3]
  KernSmooth          [2.23-20]
  MASS                [7.3-57]
  Matrix              [1.4-1]
  R6                  [2.5.1]
  RColorBrewer        [1.1-3]
  Rcpp                [1.0.8.3]
  base64enc           [0.1-3]
  bit                 [4.0.4]
  bit64               [4.0.5]
  bslib               [0.3.1]
...
  raster              [3.5-21]
  readr               [2.1.2]
  rematch             [1.0.1]
  rgdal               [1.5-32]
  rlang               [1.0.3]
  s2                  [1.0.7]
...
  1. Then I also get a list of packages that are in the lockfile, but not installed. Why is this so long? And why did these packages (seemingly all of the ones used explicitly in the code) both fail to install and also not give me a warning?
The following package(s) are recorded in the lockfile, but not installed:
                 _
  dplyr            [1.0.9]
  ggplot2          [3.3.6]
  glue             [1.6.2]
  htmltools        [0.5.2]
  htmlwidgets      [1.5.4]
  leaflet          [2.1.1]
  lubridate        [1.8.0]
  magrittr         [2.0.3]
  readxl           [1.4.0]
  scales           [1.2.0]
  sf               [1.0-7]
  shiny            [1.7.1]
  shinydashboard   [0.7.2]
  shinyjs          [2.1.0]
  stringr          [1.4.0]
  tidyr            [1.2.0]

Use `renv::restore()` to install these packages.
  1. I also see the tab for # Packages (what packages are these referring to? lockfile only? a union of lockfile and my library (which was clean)?). What information here helps me make sense of the original error about {class}?
# Packages ===========================
                   Library Source Lockfile Source Path Dependency
DBI                   <NA>   <NA>    1.1.3   CRAN <NA>       <NA>
KernSmooth         2.23-21   CRAN  2.23-20   CRAN  [2]       <NA>
MASS                7.3-60   CRAN   7.3-57   CRAN  [2]       <NA>
Matrix             1.5-4.1   CRAN    1.4-1   CRAN  [2]       <NA>
R6                    <NA>   <NA>    2.5.1   CRAN <NA>       <NA>
RColorBrewer          <NA>   <NA>    1.1-3   CRAN <NA>       <NA>
Rcpp                  <NA>   <NA>  1.0.8.3   CRAN <NA>       <NA>
base64enc             <NA>   <NA>    0.1-3   CRAN <NA>       <NA>
bit                   <NA>   <NA>    4.0.4   CRAN <NA>       <NA>
bit64                 <NA>   <NA>    4.0.5   CRAN <NA>       <NA>
boot              1.3-28.1   CRAN     <NA>   <NA>  [2]       <NA>
bslib                 <NA>   <NA>    0.3.1   CRAN <NA>       <NA>
cachem                <NA>   <NA>    1.0.6   CRAN <NA>       <NA>
cellranger            <NA>   <NA>    1.1.0   CRAN <NA>       <NA>
class               7.3-22   CRAN   7.3-20   CRAN  [2]       <NA>
...

Thank you all so much! I'd really like to start using {renv} and I'm surprised that I'm already stumped.

Grateful for any wisdom.

and complete output from renv::restore and renv::diagnostics() is below:

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

# Bootstrapping renv 0.15.5 --------------------------------------------------
* Downloading renv 0.15.5 ... OK
* Installing renv 0.15.5 ... Done!
* Successfully installed and loaded renv 0.15.5.
ℹ Using R 4.3.1 (lockfile was generated with R 4.1.2)
* Project '/cloud/project' loaded. [renv 0.15.5]
* The project library is out of sync with the lockfile.
* Use `renv::restore()` to install packages recorded in the lockfile.
> renv::restore()
The following package(s) will be updated:

# CRAN ===============================
- KernSmooth          [2.23-21 -> 2.23-20]
- MASS                [7.3-60 -> 7.3-57]
- Matrix              [1.5-4.1 -> 1.4-1]
- class               [7.3-22 -> 7.3-20]
- lattice             [0.21-8 -> 0.20-45]
- mgcv                [1.8-42 -> 1.8-40]
- nlme                [3.1-162 -> 3.1-158]
- DBI                 [* -> 1.1.3]
- R6                  [* -> 2.5.1]
- RColorBrewer        [* -> 1.1-3]
- Rcpp                [* -> 1.0.8.3]
- base64enc           [* -> 0.1-3]
- bit                 [* -> 4.0.4]
- bit64               [* -> 4.0.5]
- bslib               [* -> 0.3.1]
- cachem              [* -> 1.0.6]
- cellranger          [* -> 1.1.0]
- classInt            [* -> 0.4-7]
- cli                 [* -> 3.3.0]
- clipr               [* -> 0.8.0]
- colorspace          [* -> 2.0-3]
- commonmark          [* -> 1.8.0]
- cpp11               [* -> 0.4.2]
- crayon              [* -> 1.5.1]
- crosstalk           [* -> 1.2.0]
- digest              [* -> 0.6.29]
- dplyr               [* -> 1.0.9]
- e1071               [* -> 1.7-11]
- ellipsis            [* -> 0.3.2]
- fansi               [* -> 1.0.3]
- farver              [* -> 2.1.0]
- fastmap             [* -> 1.1.0]
- fontawesome         [* -> 0.2.2]
- forcats             [* -> 0.5.1]
- fs                  [* -> 1.5.2]
- generics            [* -> 0.1.2]
- ggplot2             [* -> 3.3.6]
- glue                [* -> 1.6.2]
- gridExtra           [* -> 2.3]
- gtable              [* -> 0.3.0]
- haven               [* -> 2.5.0]
- hms                 [* -> 1.1.1]
- htmltools           [* -> 0.5.2]
- htmlwidgets         [* -> 1.5.4]
- httpuv              [* -> 1.6.5]
- isoband             [* -> 0.2.5]
- jquerylib           [* -> 0.1.4]
- jsonlite            [* -> 1.8.0]
- labeling            [* -> 0.4.2]
- later               [* -> 1.3.0]
- lazyeval            [* -> 0.2.2]
- leaflet             [* -> 2.1.1]
- leaflet.providers   [* -> 1.9.0]
- lifecycle           [* -> 1.0.1]
- lubridate           [* -> 1.8.0]
- magrittr            [* -> 2.0.3]
- markdown            [* -> 1.1]
- mime                [* -> 0.12]
- munsell             [* -> 0.5.0]
- pillar              [* -> 1.7.0]
- pkgconfig           [* -> 2.0.3]
- png                 [* -> 0.1-7]
- prettyunits         [* -> 1.1.1]
- progress            [* -> 1.2.2]
- promises            [* -> 1.2.0.1]
- proxy               [* -> 0.4-27]
- purrr               [* -> 0.3.4]
- rappdirs            [* -> 0.3.3]
- raster              [* -> 3.5-21]
- readr               [* -> 2.1.2]
- readxl              [* -> 1.4.0]
- rematch             [* -> 1.0.1]
- rgdal               [* -> 1.5-32]
- rlang               [* -> 1.0.3]
- s2                  [* -> 1.0.7]
- sass                [* -> 0.4.1]
- scales              [* -> 1.2.0]
- sf                  [* -> 1.0-7]
- shiny               [* -> 1.7.1]
- shinydashboard      [* -> 0.7.2]
- shinyjs             [* -> 2.1.0]
- sourcetools         [* -> 0.1.7]
- sp                  [* -> 1.5-0]
- stringi             [* -> 1.7.6]
- stringr             [* -> 1.4.0]
- terra               [* -> 1.5-34]
- tibble              [* -> 3.1.7]
- tidyr               [* -> 1.2.0]
- tidyselect          [* -> 1.1.2]
- tzdb                [* -> 0.3.0]
- units               [* -> 0.8-0]
- utf8                [* -> 1.2.2]
- vctrs               [* -> 0.4.1]
- viridis             [* -> 0.6.2]
- viridisLite         [* -> 0.4.0]
- vroom               [* -> 1.5.7]
- withr               [* -> 2.5.0]
- wk                  [* -> 0.6.0]
- xfun                [* -> 0.31]
- xtable              [* -> 1.8-4]
- yaml                [* -> 2.3.5]

Do you want to proceed? [y/N]: y
* Querying repositories for available source packages ... Done!
Warning: failed to find source for 'class 7.3-20' in package repositories
Error: failed to retrieve package 'class@7.3-20'
In addition: Warning messages:
1: could not retrieve available packages for url '/src/contrib' 
2: In exists(repo, envir = `_renv_repos_archive`) : invalid first argument


> shiny::runApp()
Error in loadNamespace(x) : there is no package called ‘shiny’


> renv::diagnostics()
Diagnostics Report [renv 0.15.5]
================================

# Session Info =======================
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.6 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3 
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3;  LAPACK version 3.9.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.3.1 tools_4.3.1    renv_0.15.5   

# Project ============================
Project path: "/cloud/project"

# Status =============================
The following package(s) are no longer used in this project:
                    _
  DBI                 [1.1.3]
  KernSmooth          [2.23-20]
  MASS                [7.3-57]
  Matrix              [1.4-1]
  R6                  [2.5.1]
  RColorBrewer        [1.1-3]
  Rcpp                [1.0.8.3]
  base64enc           [0.1-3]
  bit                 [4.0.4]
  bit64               [4.0.5]
  bslib               [0.3.1]
  cachem              [1.0.6]
  cellranger          [1.1.0]
  class               [7.3-20]
  classInt            [0.4-7]
  cli                 [3.3.0]
  clipr               [0.8.0]
  colorspace          [2.0-3]
  commonmark          [1.8.0]
  cpp11               [0.4.2]
  crayon              [1.5.1]
  crosstalk           [1.2.0]
  digest              [0.6.29]
  e1071               [1.7-11]
  ellipsis            [0.3.2]
  fansi               [1.0.3]
  farver              [2.1.0]
  fastmap             [1.1.0]
  fontawesome         [0.2.2]
  forcats             [0.5.1]
  fs                  [1.5.2]
  generics            [0.1.2]
  gridExtra           [2.3]
  gtable              [0.3.0]
  haven               [2.5.0]
  hms                 [1.1.1]
  httpuv              [1.6.5]
  isoband             [0.2.5]
  jquerylib           [0.1.4]
  jsonlite            [1.8.0]
  labeling            [0.4.2]
  later               [1.3.0]
  lattice             [0.20-45]
  lazyeval            [0.2.2]
  leaflet.providers   [1.9.0]
  lifecycle           [1.0.1]
  markdown            [1.1]
  mgcv                [1.8-40]
  mime                [0.12]
  munsell             [0.5.0]
  nlme                [3.1-158]
  pillar              [1.7.0]
  pkgconfig           [2.0.3]
  png                 [0.1-7]
  prettyunits         [1.1.1]
  progress            [1.2.2]
  promises            [1.2.0.1]
  proxy               [0.4-27]
  purrr               [0.3.4]
  rappdirs            [0.3.3]
  raster              [3.5-21]
  readr               [2.1.2]
  rematch             [1.0.1]
  rgdal               [1.5-32]
  rlang               [1.0.3]
  s2                  [1.0.7]
  sass                [0.4.1]
  sourcetools         [0.1.7]
  sp                  [1.5-0]
  stringi             [1.7.6]
  terra               [1.5-34]
  tibble              [3.1.7]
  tidyselect          [1.1.2]
  tzdb                [0.3.0]
  units               [0.8-0]
  utf8                [1.2.2]
  vctrs               [0.4.1]
  viridis             [0.6.2]
  viridisLite         [0.4.0]
  vroom               [1.5.7]
  withr               [2.5.0]
  wk                  [0.6.0]
  xfun                [0.31]
  xtable              [1.8-4]
  yaml                [2.3.5]

Use `renv::snapshot()` to remove them from the lockfile.

The following package(s) are recorded in the lockfile, but not installed:
                 _
  dplyr            [1.0.9]
  ggplot2          [3.3.6]
  glue             [1.6.2]
  htmltools        [0.5.2]
  htmlwidgets      [1.5.4]
  leaflet          [2.1.1]
  lubridate        [1.8.0]
  magrittr         [2.0.3]
  readxl           [1.4.0]
  scales           [1.2.0]
  sf               [1.0-7]
  shiny            [1.7.1]
  shinydashboard   [0.7.2]
  shinyjs          [2.1.0]
  stringr          [1.4.0]
  tidyr            [1.2.0]

Use `renv::restore()` to install these packages.


# Packages ===========================
                   Library Source Lockfile Source Path Dependency
DBI                   <NA>   <NA>    1.1.3   CRAN <NA>       <NA>
KernSmooth         2.23-21   CRAN  2.23-20   CRAN  [2]       <NA>
MASS                7.3-60   CRAN   7.3-57   CRAN  [2]       <NA>
Matrix             1.5-4.1   CRAN    1.4-1   CRAN  [2]       <NA>
R6                    <NA>   <NA>    2.5.1   CRAN <NA>       <NA>
RColorBrewer          <NA>   <NA>    1.1-3   CRAN <NA>       <NA>
Rcpp                  <NA>   <NA>  1.0.8.3   CRAN <NA>       <NA>
base64enc             <NA>   <NA>    0.1-3   CRAN <NA>       <NA>
bit                   <NA>   <NA>    4.0.4   CRAN <NA>       <NA>
bit64                 <NA>   <NA>    4.0.5   CRAN <NA>       <NA>
boot              1.3-28.1   CRAN     <NA>   <NA>  [2]       <NA>
bslib                 <NA>   <NA>    0.3.1   CRAN <NA>       <NA>
cachem                <NA>   <NA>    1.0.6   CRAN <NA>       <NA>
cellranger            <NA>   <NA>    1.1.0   CRAN <NA>       <NA>
class               7.3-22   CRAN   7.3-20   CRAN  [2]       <NA>
classInt              <NA>   <NA>    0.4-7   CRAN <NA>       <NA>
cli                   <NA>   <NA>    3.3.0   CRAN <NA>       <NA>
clipr                 <NA>   <NA>    0.8.0   CRAN <NA>       <NA>
cluster              2.1.4   CRAN     <NA>   <NA>  [2]       <NA>
codetools           0.2-19   CRAN     <NA>   <NA>  [2]       <NA>
colorspace            <NA>   <NA>    2.0-3   CRAN <NA>       <NA>
commonmark            <NA>   <NA>    1.8.0   CRAN <NA>       <NA>
cpp11                 <NA>   <NA>    0.4.2   CRAN <NA>       <NA>
crayon                <NA>   <NA>    1.5.1   CRAN <NA>       <NA>
crosstalk             <NA>   <NA>    1.2.0   CRAN <NA>       <NA>
digest                <NA>   <NA>   0.6.29   CRAN <NA>       <NA>
dplyr                 <NA>   <NA>    1.0.9   CRAN <NA>     direct
e1071                 <NA>   <NA>   1.7-11   CRAN <NA>       <NA>
ellipsis              <NA>   <NA>    0.3.2   CRAN <NA>       <NA>
fansi                 <NA>   <NA>    1.0.3   CRAN <NA>       <NA>
farver                <NA>   <NA>    2.1.0   CRAN <NA>       <NA>
fastmap               <NA>   <NA>    1.1.0   CRAN <NA>       <NA>
fontawesome           <NA>   <NA>    0.2.2   CRAN <NA>       <NA>
forcats               <NA>   <NA>    0.5.1   CRAN <NA>       <NA>
foreign             0.8-84   CRAN     <NA>   <NA>  [2]       <NA>
fs                    <NA>   <NA>    1.5.2   CRAN <NA>       <NA>
generics              <NA>   <NA>    0.1.2   CRAN <NA>       <NA>
ggplot2               <NA>   <NA>    3.3.6   CRAN <NA>     direct
glue                  <NA>   <NA>    1.6.2   CRAN <NA>     direct
gridExtra             <NA>   <NA>      2.3   CRAN <NA>       <NA>
gtable                <NA>   <NA>    0.3.0   CRAN <NA>       <NA>
haven                 <NA>   <NA>    2.5.0   CRAN <NA>       <NA>
hms                   <NA>   <NA>    1.1.1   CRAN <NA>       <NA>
htmltools             <NA>   <NA>    0.5.2   CRAN <NA>     direct
htmlwidgets           <NA>   <NA>    1.5.4   CRAN <NA>     direct
httpuv                <NA>   <NA>    1.6.5   CRAN <NA>       <NA>
isoband               <NA>   <NA>    0.2.5   CRAN <NA>       <NA>
jquerylib             <NA>   <NA>    0.1.4   CRAN <NA>       <NA>
jsonlite              <NA>   <NA>    1.8.0   CRAN <NA>       <NA>
labeling              <NA>   <NA>    0.4.2   CRAN <NA>       <NA>
later                 <NA>   <NA>    1.3.0   CRAN <NA>       <NA>
lattice             0.21-8   CRAN  0.20-45   CRAN  [2]       <NA>
lazyeval              <NA>   <NA>    0.2.2   CRAN <NA>       <NA>
leaflet               <NA>   <NA>    2.1.1   CRAN <NA>     direct
leaflet.providers     <NA>   <NA>    1.9.0   CRAN <NA>       <NA>
lifecycle             <NA>   <NA>    1.0.1   CRAN <NA>       <NA>
lubridate             <NA>   <NA>    1.8.0   CRAN <NA>     direct
magrittr              <NA>   <NA>    2.0.3   CRAN <NA>     direct
markdown              <NA>   <NA>      1.1   CRAN <NA>       <NA>
mgcv                1.8-42   CRAN   1.8-40   CRAN  [2]       <NA>
mime                  <NA>   <NA>     0.12   CRAN <NA>       <NA>
munsell               <NA>   <NA>    0.5.0   CRAN <NA>       <NA>
nlme               3.1-162   CRAN  3.1-158   CRAN  [2]       <NA>
nnet                7.3-19   CRAN     <NA>   <NA>  [2]       <NA>
pillar                <NA>   <NA>    1.7.0   CRAN <NA>       <NA>
pkgconfig             <NA>   <NA>    2.0.3   CRAN <NA>       <NA>
png                   <NA>   <NA>    0.1-7   CRAN <NA>       <NA>
prettyunits           <NA>   <NA>    1.1.1   CRAN <NA>       <NA>
progress              <NA>   <NA>    1.2.2   CRAN <NA>       <NA>
promises              <NA>   <NA>  1.2.0.1   CRAN <NA>       <NA>
proxy                 <NA>   <NA>   0.4-27   CRAN <NA>       <NA>
purrr                 <NA>   <NA>    0.3.4   CRAN <NA>       <NA>
rappdirs              <NA>   <NA>    0.3.3   CRAN <NA>       <NA>
raster                <NA>   <NA>   3.5-21   CRAN <NA>       <NA>
readr                 <NA>   <NA>    2.1.2   CRAN <NA>       <NA>
readxl                <NA>   <NA>    1.4.0   CRAN <NA>     direct
rematch               <NA>   <NA>    1.0.1   CRAN <NA>       <NA>
renv                0.15.5   RSPM   0.15.5   CRAN  [1]     direct
rgdal                 <NA>   <NA>   1.5-32   CRAN <NA>       <NA>
rlang                 <NA>   <NA>    1.0.3   CRAN <NA>       <NA>
rpart               4.1.19   CRAN     <NA>   <NA>  [2]       <NA>
s2                    <NA>   <NA>    1.0.7   CRAN <NA>       <NA>
sass                  <NA>   <NA>    0.4.1   CRAN <NA>       <NA>
scales                <NA>   <NA>    1.2.0   CRAN <NA>     direct
sf                    <NA>   <NA>    1.0-7   CRAN <NA>     direct
shiny                 <NA>   <NA>    1.7.1   CRAN <NA>     direct
shinydashboard        <NA>   <NA>    0.7.2   CRAN <NA>     direct
shinyjs               <NA>   <NA>    2.1.0   CRAN <NA>     direct
sourcetools           <NA>   <NA>    0.1.7   CRAN <NA>       <NA>
sp                    <NA>   <NA>    1.5-0   CRAN <NA>       <NA>
spatial             7.3-16   CRAN     <NA>   <NA>  [2]       <NA>
stringi               <NA>   <NA>    1.7.6   CRAN <NA>       <NA>
stringr               <NA>   <NA>    1.4.0   CRAN <NA>     direct
survival             3.5-5   CRAN     <NA>   <NA>  [2]       <NA>
terra                 <NA>   <NA>   1.5-34   CRAN <NA>       <NA>
tibble                <NA>   <NA>    3.1.7   CRAN <NA>       <NA>
tidyr                 <NA>   <NA>    1.2.0   CRAN <NA>     direct
tidyselect            <NA>   <NA>    1.1.2   CRAN <NA>       <NA>
tzdb                  <NA>   <NA>    0.3.0   CRAN <NA>       <NA>
units                 <NA>   <NA>    0.8-0   CRAN <NA>       <NA>
utf8                  <NA>   <NA>    1.2.2   CRAN <NA>       <NA>
utils                 <NA>   <NA>     <NA>   <NA>  [2]   indirect
vctrs                 <NA>   <NA>    0.4.1   CRAN <NA>       <NA>
viridis               <NA>   <NA>    0.6.2   CRAN <NA>       <NA>
viridisLite           <NA>   <NA>    0.4.0   CRAN <NA>       <NA>
vroom                 <NA>   <NA>    1.5.7   CRAN <NA>       <NA>
withr                 <NA>   <NA>    2.5.0   CRAN <NA>       <NA>
wk                    <NA>   <NA>    0.6.0   CRAN <NA>       <NA>
xfun                  <NA>   <NA>     0.31   CRAN <NA>       <NA>
xtable                <NA>   <NA>    1.8-4   CRAN <NA>       <NA>
yaml                  <NA>   <NA>    2.3.5   CRAN <NA>       <NA>

[1]: /cloud/project/renv/library/R-4.3/x86_64-pc-linux-gnu
[2]: /opt/R/4.3.1/lib/R/library                           

# ABI ================================
* No ABI conflicts were detected in the set of installed packages.

# User Profile =======================
[no user profile detected]

# Settings ===========================
List of 10
 $ bioconductor.version     : chr(0) 
 $ external.libraries       : chr(0) 
 $ ignored.packages         : chr(0) 
 $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
 $ r.version                : chr(0) 
 $ snapshot.type            : chr "implicit"
 $ use.cache                : logi TRUE
 $ vcs.ignore.cellar        : logi TRUE
 $ vcs.ignore.library       : logi TRUE
 $ vcs.ignore.local         : logi TRUE

# Options ============================
List of 10
 $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
 $ download.file.method                : chr "libcurl"
 $ download.file.extra                 : NULL
 $ install.packages.compile.from.source: NULL
 $ pkgType                             : chr "source"
 $ repos                               : Named chr ""
  ..- attr(*, "names")= chr "CRAN"
 $ renv.consent                        : logi TRUE
 $ renv.project.path                   : chr "/cloud/project"
 $ renv.download.trace                 : logi TRUE
 $ renv.verbose                        : logi TRUE

# Environment Variables ==============
HOME                        = /home/r1983886
LANG                        = C.UTF-8
MAKE                        = make
R_LIBS                      = <NA>
R_LIBS_SITE                 = /opt/R/4.3.1/lib/R/site-library
R_LIBS_USER                 = /cloud/project/renv/library/R-4.3/x86_64-pc-linux-gnu:/opt/R/4.3.1/lib/R/library
RENV_DEFAULT_R_ENVIRON      = /etc/R/Renviron.site
RENV_DEFAULT_R_ENVIRON_USER = <NA>
RENV_DEFAULT_R_LIBS         = <NA>
RENV_DEFAULT_R_LIBS_SITE    = /opt/R/4.3.1/lib/R/site-library
RENV_DEFAULT_R_LIBS_USER    = /cloud/home/r1983886/R/x86_64-pc-linux-gnu-library/4.3
RENV_DEFAULT_R_PROFILE      = /etc/R/Rprofile.site
RENV_DEFAULT_R_PROFILE_USER = <NA>
RENV_PATHS_CACHE            = /cloud/lib/renv/cache
RENV_PROJECT                = /cloud/project

# PATH ===============================
- /usr/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
- /home/r1983886/.local/bin
- /opt/R/4.3.1/lib/R/bin
- /opt/quarto/1.3.354/bin
- /usr/lib/rstudio-server/bin/postback

# Cache ==============================
There are a total of 0 package(s) installed in the renv cache.
Cache path: "/cloud/lib/renv/cache/v5/R-4.3/x86_64-pc-linux-gnu"

I think I happen to know the answer to this.

First - the problem with class is probably to do with the R version you are using on Posit.Cloud. I just happened to come across this SO post today. The lockfile you linked to is for R4.1 - and Posit.Cloud is giving you 4.3.

The other thing worth noting about that lock file is that it seems to be malformed - there should be a URL associated with the repository.

There is hope though. If you just want to get the project running you could try renv::init()and follow the 'Discard the lockfile and re-initialize" option. This will essentially just start from scratch, with newer versions of the packages. I usually find this works. See this section of the renv docs.

To your other questions:

  1. Not sure what's going on there. Sorry.
  2. When renv failed to install class, it just stopped. So everything listed in the lock file below class (that's not a dependency of a package above class) was not installed. You'll notice that the first package starts with 'd' because renv more-or-less goes down the list alphabetically.
  3. This is part of diagnostics, but not really helpful for the problem with class.

FWIW - the problem with renv not playing nicely with different versions of R is an easy trap to fall into. Unlike other environment managers (like conda or venv for python), renv only deals with the packages and doesn't create a virtual environment for the version of R. Most of the time this doesn't matter - R doesn't make wild changes in the way Python sometimes does. But it does mean that sometimes renv just breaks.

2 Likes

Wow, thanks @Taren_Sanders ! That is indeed a perfect SO post. Thanks for taking the time to share it!

I did notice the R version difference but I naively thought 4.1.x and 4.3.x "surely weren't that different". Ha.

Despite knowing the alphabet for several decades, I actually did not notice the alphabetical detail about what was successfully installed vs not -- it is so much nicer to know that it failed for one package, not several.

Thanks soo much for taking the time to type this out and linking to both the SO and the section of {renv} documentation -- it makes {renv} feel much more manageable.

1 Like

Glad that helps! And, I hope this doesn't dissuade you from using renv. It is a really useful tool, especially if you often collaborate on projects.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.