Last active
March 23, 2018 16:24
-
-
Save revodavid/8b473aa786ff1443362935c5725f35a0 to your computer and use it in GitHub Desktop.
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
library(tidyverse) | |
library(stringr) | |
library(stringi) | |
simplify_name <- function(n) | |
## Extract just the name, removing any quotes, and normalize accented characters | |
stri_trans_general(str_trim(str_match(n,"^[\'\"]?([^\'\",(<]+).*<")[,2]),"latin-ascii") | |
pkglist <- tools::CRAN_package_db() | |
pkglist <- tbl_df(pkglist[-40]) ## remove duplicate MD5sum column | |
pkglist %>% | |
select(Maintainer, Author, Package) %>% | |
arrange(Maintainer) -> authors | |
authors %>% | |
transmute(Maint = simplify_name(Maintainer)) %>% | |
group_by(Maint) %>% | |
tally %>% arrange(desc(n)) -> topauthors | |
as.data.frame(head(topauthors,20)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment