Last active
July 29, 2022 08:13
-
-
Save zhilongjia/9cfb3666ecfb0dc513386052b244f79c to your computer and use it in GitHub Desktop.
obtain the total number of downloads of a bioconductor package.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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