awesome-official-statistics-software icon indicating copy to clipboard operation
awesome-official-statistics-software copied to clipboard

Feature extension: last code change

Open olavtenbosch opened this issue 1 year ago • 3 comments

The idea was suggested to add to each item the last code change of the particular item, thus giving an indication of the maintenance activity of the package, derived from the source code control system it uses.

olavtenbosch avatar Aug 17 '22 15:08 olavtenbosch

As a possible start: the following code gets the last updated dates for CRAN-packages.

library(rvest)

dta <- read.csv("data/software.csv")


cran <- grep("^http[s]?://(CRAN|cran).*package=.*$", dta$link)

dates <- as.Date(rep(NA, length(cran)))
for (i in seq_along(cran)) {
  try({
    h <- read_html(dta$link[cran[i]])
    tab <- h %>% html_element("table") %>% html_table()
    published <- tab[[2]][grep("^Published:", tab[[1]])]
    dates[i] <- as.Date(published)
  })
}

dta$last_updated <- as.Date(NA)
dta$last_updated[cran] <- dates

djvanderlaan avatar Sep 20 '22 15:09 djvanderlaan

Actually an easier/better way to handle this is to use badges. See https://github.com/djvanderlaan/awesome-official-statistics-software where I have added badges to two packages. We can use https://www.r-pkg.org/services for packages on CRAN and https://shields.io/ for packages on github/gitlab.

djvanderlaan avatar Sep 21 '22 15:09 djvanderlaan

Thanks Jan,

Yes, that's much better indeed. I'll have look at a possible implementation soon.

Olav

olavtenbosch avatar Sep 21 '22 16:09 olavtenbosch