Skip to content

Instantly share code, notes, and snippets.

@jsta
Last active December 7, 2020 17:32
Show Gist options
  • Save jsta/666952b6c36336157486e865fdf576ba to your computer and use it in GitHub Desktop.
Save jsta/666952b6c36336157486e865fdf576ba to your computer and use it in GitHub Desktop.
Get summary information for an entire CRAN Task View
library(packagemetrics) # devtools::install_github("ropenscilabs/packagemetrics")
library(ctv)
library(dplyr)
task_view <- "Optimization"
out_path <- paste0(task_view, ".rds")
pkgs <- ctv:::.get_pkgs_from_ctv_or_repos(task_view)
pkgs <- as.character(as.data.frame(pkgs[1])[,1])
if(!file.exists(out_path)){
pkg_metrics <- packagemetrics::package_list_metrics(pkgs)
saveRDS(pkg_metrics, out_path)
}
pkg_metrics <- readRDS(out_path) %>%
distinct(package, .keep_all = TRUE) %>%
dplyr::filter(stars > 0 & !is.na(stars)) %>%
arrange(desc(stars)) %>%
dplyr::filter(!(package %in% c("igraph"))) # remove this outlier
metrics_table(pkg_metrics)
@jsta
Copy link
Author

jsta commented Dec 7, 2020

Rplot

@jsta
Copy link
Author

jsta commented Dec 7, 2020

> names(pkg_metrics)
 [1] "package"            "published"          "title"             
 [4] "depends_count"      "suggests_count"     "tidyverse_happy"   
 [7] "has_vignette_build" "has_tests"          "reverse_count"     
[10] "dl_last_month"      "ci"                 "test_coverage"     
[13] "forks"              "stars"              "watchers"          
[16] "last_commit"        "last_issue_closed"  "contributors"   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment