Using library(checkpoint) in RStudio Cloud

When I try to use library(checkpoint) and set a checkpoint (e.g., checkpoint("2020-07-16")), it seems re-installing every package every time I start the RStudio Cloud.
Can you please store some checkpoints in the cloud server, so that all users may achieve reproducibility? If entire checkpoints are not feasible, what about just pre-installing checkpoints for all versions of tidyverse and R notebook etc., developed by RStudio?
Thank you!

Is it doing that in the same RStudio cloud RStudio session ? because I believed a package installed in one session would be still available in this session if you close and reopens it. However, it you start a new session, it will go fresh everytime. Each sessions are independant. So if another user use the same script as yours with checkpoint, but in a new session, it will reinstall all from the checkpoint url, but reinstall it no matter what.

This is because I believe checkpoint("2020-07-16") will just point to a snapshot of the cran server at this date, and you'll be able to install package from this date. But it won't cache package for others session.

Know that you can achieve the same with https://packagemanager.rstudio.com by using one of the snapshot url. See Posit Package Manager
You can for example use this url to use a snapshot of the 2020-07-06:

options(repos = c(CRAN= "https://packagemanager.rstudio.com/cran/299"))

One advantage for rstudio cloud is that you can have linux binaries available, which will make all the packages a lot quicker to install ( very fast !!). You would use this url in this case:

options(repos = c(CRAN= "https://packagemanager.rstudio.com/cran/__linux__/bionic/299"))

If everyone is using the same CRAN url for a project, the package version will stay the same. Like with the checkpoint package. But, the binary availability feature is really a game changer for unix environment ! so quick to install a bunch of package. So it will be a lot easier for your other users to install the same environment. (And I believe Rstudio cloud is using linux binaries with latest cran version by default, so you see easily how fast it is).

If you did not know about Public Package Manager, here the announcement post:

Hope it helps with your use case.

1 Like

Just wanted to add that you can set up a session in RStudio cloud with all the required packages installed, and then you can share it so that other can benefit from this already set up session
See about sharing here: Posit Cloud

1 Like

@cderv Thank you so much for your kind explanation! Packagemanager works well. Also, thank you so much for letting me know the binary snapshot. I Did not know, this is great!

Just to double check, when I run sessionInfo() in my RStudio.Cloud, it says "Running under: Ubuntu 16.04.6 LTS". So "https://packagemanager.rstudio.com/cran/linux/xenial/302" would be the right choice? Or would bionic be the better choice still?

Also, thank you so much for your advice on pre-installing and sharing a session!

Oh yes choose the right OS for you! I may have chose the wrong one :slight_smile:

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.