Well crap. A project from over 5 years ago, when I wasn't doing things well, and I've not got package versions recorded, and was doing all of the analysis via a `knitr` script, with very few intermediates saved.

And now collabs have reviewer comments, and want to change some outputs.

The package is under a git repo, but figuring out how far back to go is a pain in the butt.

So glad using `renv` now at least gives me a record of what versions I had at the time of analysis. #RStats

Update to this situation. For some reason, I didn't read my Rmd document all the way through (there is a lot of stuff, I was interested in parts of it, and restarting it), and it turns out that I saved the whole dang set of objects to an #RStats RData file!

So at least I have all the objects using in the analysis!

Will see how much that actually helps tomorrow.

@rmflight Maybe start with R 3.6? (good luck!)
@defuneste eh, hopefully I don't have to go that far back. 😬

@rmflight I have been there, good luck! I was quite scared but it wasn't that hard. check git commit dates and look for "date when the analysis started" (close to the first commits). Then use the released R version from that date. Next, setup the posit package manager to somewhere in the middle of the git commit dates. Why middle? You don't install new packages when you are fixing last bugs, but you may need some extra package mid analysis, so middle worked well for me.

And that's it.

@rmflight I created a package with a function for this situation (if you have the session info or at least some versions recorded): https://llrs.github.io/repo.data/reference/cran_date.html

I hope you manage to continue the project and successfully answer the reviwers (and colleagues).

Estimate CRAN's date — cran_date

Check which CRAN dates are possible for a given packages and versions.

@rmflight It works even without known versions:

cran_date(versions = data.frame(Package = c("rversions", "rtoot"), Version = NA))
[1] "2022-11-11"

Which would be when these two packages are first on CRAN. Edit2: fixed typo. The function works correctly.

I'm working on making it work with Bioconductor packages (and version) but I think that just a date would be close enough.