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?
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 https://mran.microsoft.com/timemachine 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