R image cran repo fixed to older release

Hi all

We’re currently setting up an R based image and are installing a number of packages, including “rfishbase”. That package specifically had an update recently (3.1.9), but installing it in our image installs an older version (3.1.7).

We are using the most recent base image renku/renkulab-r:4.0.5-0.8.0

I found that the cran repository is fixed to an older version from earlier this year:

options(“repos”)
$repos
CRAN
https://packagemanager.rstudio.com/cran/linux/focal/2021-05-17

A bunch of questions to that:
Where is that repo specified?
Do you have any package caching in place or can I just overwrite the repo in the install.R file?

Thanks and cheers

Hi there,

Thanks for reporting that. The repo is inherited from some of the Rocker images that we use to build Renku images. There is a way to specify the specific version numbers in R.

In your install.R file you can put this code:

require(devtools)

install_version("rfishbase", version = "3.1.9", repos = "http://cran.us.r-project.org")

which will pull the version you want. When I start a session in that project, I can call rfishbase with the right version:

Let us know if this still doesn’t solve the issue.

Cheers!
Gavin

Hi Gavin

Thanks for that snippet. I looked into the rocker images, they seem to fix the repo for reproducibility.

Using your snippet for selecting a version works just as well as this for installing the latest one:

install.packages('rfishbase',dependencies=TRUE, repos='http://cran.rstudio.com/')

I found the documentation on setting up a newer repo version with the rstudio package manager:
https://packagemanager.rstudio.com/client/#/repos/1/overview

cheers