Skip to content

Instantly share code, notes, and snippets.

@zhilongjia
Last active July 29, 2022 08:13
Show Gist options
  • Save zhilongjia/9cfb3666ecfb0dc513386052b244f79c to your computer and use it in GitHub Desktop.
Save zhilongjia/9cfb3666ecfb0dc513386052b244f79c to your computer and use it in GitHub Desktop.
obtain the total number of downloads of a bioconductor package.
## Bioconductor package download
library(dplyr)
pkname="cogena"
cogena_download_tabs <- readr::read_tsv(paste0("http://bioconductor.org/packages/stats/bioc/", pkname, "/", pkname, "_stats.tab") )
print("The total downloading number of cogena: ")
dplyr::filter(cogena_download_tabs, Month=="all") %>%
select(Nb_of_downloads) %>% unlist(use.names = FALSE) %>% sum()
#####################################################
# Or via `BiocPkgTools` package
library(dplyr)
library(BiocPkgTools)
all_Nb_downloads <- biocDownloadStats()
print("The total downloading number of cogena: ")
dplyr::filter(all_Nb_downloads, Package=="cogena", Month=="all", repo=="Software") %>%
select(Nb_of_downloads) %>% unlist(use.names = FALSE) %>% sum()
# dplyr::summarise_at(vars(Nb_of_downloads), sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment