You can use cran package 'pkgsearch' to look at historical versions
mysearch <- function(pkg){
require(tidyverse)
require(pkgsearch)
cran_package_history(pkg) |>
select(Package,Date,Version,dependencies) |>
rowwise() |>
mutate(Date=ymd(Date),
R_VERSION = filter(dependencies,package=="R")) |>
ungroup() |>
arrange(desc(Date))
}
mysearch("MASS")
# A tibble: 70 × 5
Package Date Version dependencies R_VERSION$type $package $version
<chr> <date> <chr> <list> <chr> <chr> <chr>
1 MASS 2024-01-12 7.3-60.0.1 <df [10 × 3]> Depends R >= 4.0
2 MASS 2024-01-12 7.3-60.2 <df [10 × 3]> Depends R >= 4.4.0
3 MASS 2023-07-13 7.3-60.1 <df [10 × 3]> Depends R >= 4.4.0
4 MASS 2023-07-07 7.3-58.3 <df [10 × 3]> Depends R >= 3.3.0
5 MASS 2023-05-02 7.3-60 <df [10 × 3]> Depends R >= 4.0
6 MASS 2023-04-03 7.3-59 <df [10 × 3]> Depends R >= 4.2.0
7 MASS 2023-01-21 7.3-58.2 <df [10 × 3]> Depends R >= 3.3.0
8 MASS 2022-07-27 7.3-58.1 <df [10 × 3]> Depends R >= 3.3.0
9 MASS 2022-07-14 7.3-58 <df [11 × 3]> Depends R >= 3.3.0
10 MASS 2022-05-29 7.3-57.1 <df [10 × 3]> Depends R >= 3.3.0
# ℹ 60 more rows
and if you use a package manager like renv
that can install specific versions via its MASS@version
syntax (i.e. renv::install("MASS@7.3-60")
you might be able to cobble together a solution.