How can one check of a package has been archived from CRAN. One can check if a package is a CRAN package like so:
"ggplot2" %in% available.packages()[,1]
## [1] TRUE
But a package like helpr shows false with the same code. How could I check if a name is archived?
"helpr" %in% available.packages()[,1]
## [1] FALSE
I could scrape the archive like this:
archs <- XML::readHTMLTable(readLines("https://cran.r-project.org/src/contrib/Archive/"),
stringsAsFactors = FALSE)
gsub("/$", "", na.omit(archs[[1]][, "Name"]))
but I assume there is a built in base way to to do this as using an archived package name will throw a warning in a CRAN check.
tools
package (or maybeutils
, I always mix that up), so did you look? – Onassis