Advice on version control

I have a two part question on version control.

  1. Looking backwards: If you have old R code and know the date on which the code was run, is there a reasonable way to find the version of R and of packages that were likely current at the time the code was run?

  2. Looking forward: Is there a way to embed code in a script which would make it easy for someone to re-run the code years later with the same R and package versions as used originally.

The context is for a small shop where the people writing code are not professional programmers. So something low cost and easy would be nice. But all advice appreciated.

yes. you can look at the Home MRAN timemachine to see what the latest package version was on cran/mran at a point in time.

yes. do your work witin rstudio projects and use renv package to record the versions used

Also, I recommend you leverage RStudio's ability to integrate with git and github to source control your projects.
https://r-bio.github.io/intro-git-rstudio/

1 Like

Really helpful @nirgrahamuk. Much appreciated.

This topic was automatically closed 21 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.