Skip to contents

Retrieve a list of all currently archived R packages and their archive date

Usage

archivedPkg(
  startsWith = c("all", letters),
  after = NULL,
  inc.date = TRUE,
  as = c("data.frame", "list")
)

Arguments

startsWith

one letter that the package name starts with eg. a, e, f

after

packages archived after a specific date eg. 2011-05-10

inc.date

should archive date be included in the result

as

return result as data frame or as list

Value

a data frame or list containing listing of all archived R packages

Note

* The "startsWith" argument should be one letter and should be in lowercase
* If no argument is provided for "startsWith", all the packages will be retrieved
* The format of the "after" argument must be YYYY-MM-DD e.g. 2022-04-11

Use case

This function allows the retrieval of various R packages archived by CRAN along with the respective latest archive date. The packages retrieved include both active and inactive R projects submitted to CRAN. When a new version of an active R package is published, the older versions of the package gets archived. In the same way, when a package is decommissioned from CRAN active projects for one reason or another, it gets archived.

Examples

# \donttest{
# Task 1: get archived R packages with names beginning with C or All
head(archivedPkg(startsWith = "all"), n= 10) #retrieves all packages
#>            name latest.archive arch.status
#> 1            A3     2015-08-16      active
#> 2      AATtools     2022-08-12      active
#> 3   ABCExtremes     2015-06-19       decom
#> 4   ABCanalysis     2017-03-13      active
#> 5      ABCoptim     2017-11-06      active
#> 6         ABCp2     2015-07-01      active
#> 7  ABHgenotypeR     2016-02-04      active
#> 8           ABM     2024-03-14      active
#> 9          ABPS     2018-10-18      active
#> 10          ACA     2018-07-02      active
head(archivedPkg(startsWith = "c"), n= 10) #retrieves only packages beginning with a
#>           name latest.archive arch.status
#> 1     C19dNUTS     2022-10-04      active
#> 2          C50     2023-02-08      active
#> 3         C443     2023-06-21      active
#> 4  CA3variants     2022-10-10      active
#> 5     CADFtest     2017-06-02      active
#> 6      CADStat     2024-03-01       decom
#> 7  CAGExploreR     2014-06-10       decom
#> 8         CAGR     2024-03-02      active
#> 9       CAISEr     2022-11-16      active
#> 10     CALANGO     2023-04-26      active

# Task 2: return the packages from Task 1 without including latest archive date
res.dt2 <- archivedPkg(startsWith = "b", inc.date = FALSE)
res.dt2[1:10,]
#>        name arch.status
#> 1       B2Z       decom
#> 2      BACA       decom
#> 3     BACCO      active
#> 4  BACprior      active
#> 5     BADER       decom
#> 6    BAEssd       decom
#> 7    BAGofT      active
#> 8   BALCONY       decom
#> 9      BALD       decom
#> 10    BAMBI      active

# Task 3: return the results from Task 2 as a list
res.dt3 <- archivedPkg(startsWith = "c", inc.date = FALSE, as = "list")
res.dt3$name[1:10]
#>  [1] "C19dNUTS"    "C50"         "C443"        "CA3variants" "CADFtest"   
#>  [6] "CADStat"     "CAGExploreR" "CAGR"        "CAISEr"      "CALANGO"    

res.dt3 <- archivedPkg(startsWith = "e", as = "list")
res.dt3$name[1:10]
#>  [1] "E4tools"      "EAinference"  "EAlasso"      "EBASE"        "EBASS"       
#>  [6] "EBEN"         "EBMAforecast" "EBPRS"        "EBS"          "EBglmnet"    

# Task 4: return the archived packages beginning with Y archived after 2022-08-12
# Note that startsWith should be lowercase

#without archive date
yRPkg <- archivedPkg(startsWith = "y", after= NULL)
nrow(yRPkg) #number of rows returned
#> [1] 54
head(yRPkg, n = 15) #show first 15 rows
#>                name latest.archive arch.status
#> 1  YPInterimTesting     2019-06-07      active
#> 2              YPPE     2020-01-09      active
#> 3           YPmodel     2020-02-19      active
#> 4            YRmisc     2020-03-01      active
#> 5       YTAnalytics     2023-09-14      active
#> 6       YaleToolkit     2022-05-09      active
#> 7              Yamm     2023-03-02       decom
#> 8       YatchewTest     2024-07-23      active
#> 9        YieldCurve     2022-05-09      active
#> 10          YjdnJlp     2013-12-21       decom
#> 11         YourCast     2015-09-01       decom
#> 12        YplantQMC     2018-02-28       decom
#> 13           YuGene     2021-04-15       decom
#> 14     yCrypticRNAs     2018-05-09       decom
#> 15         yaImpute     2023-12-13      active

#with archive date
yRPkg2 <- archivedPkg(startsWith = "y", after= "2022-08-12")
nrow(yRPkg2) #number of rows returned
#> [1] 28
head(yRPkg2, n = 15) #show first 15 rows, notice no archive date before 2022-08-12
#>             name latest.archive arch.status
#> 5    YTAnalytics     2023-09-14      active
#> 7           Yamm     2023-03-02       decom
#> 8    YatchewTest     2024-07-23      active
#> 15      yaImpute     2023-12-13      active
#> 18 yahoofinancer     2024-02-03      active
#> 19        yakmoR     2022-09-27       decom
#> 20          yaml     2024-07-26      active
#> 21        yamlet     2024-03-29      active
#> 22        yamlme     2022-11-09      active
#> 23           yap     2023-04-07       decom
#> 24          yaps     2023-03-12       decom
#> 25     yardstick     2024-03-21      active
#> 26          yarr     2024-07-16       decom
#> 29         yatah     2024-04-13      active
#> 30         ycevo     2024-06-05      active
# }