R weekly new editor

Rweekly is looking for new editors. But they need to have submitted “at least 6 PRs on R Weekly”. If you submitted something through the webpage you also can apply. But I’ll look at how many people has submitted pull requests (PR) through GitHub at the repo rweekly/rewekly.

GH

So the GH package is good for this, but we need to know the API of Github. After a quick search I found the end point of the API:

library("gh")
PR <- gh("GET /search/issues?q=repo:rweekly/rweekly.org+is:pr+is:merged&per_page=100") # Copied from https://developer.github.com/v3/pulls/
PR$total_count
## [1] 555

We know that there have been 552, we’ll need 6 calls to the appy, because it returns 100 values on each call.

This time we’ll use copy and paste for a quick solution:

PR2 <- gh("GET /search/issues?q=repo:rweekly/rweekly.org+is:pr+is:merged&per_page=100&page=2")
PR3 <- gh("GET /search/issues?q=repo:rweekly/rweekly.org+is:pr+is:merged&per_page=100&page=3")
PR4 <- gh("GET /search/issues?q=repo:rweekly/rweekly.org+is:pr+is:merged&per_page=100&page=4")
PR5 <- gh("GET /search/issues?q=repo:rweekly/rweekly.org+is:pr+is:merged&per_page=100&page=5")
PR6 <- gh("GET /search/issues?q=repo:rweekly/rweekly.org+is:pr+is:merged&per_page=100&page=6")

Now that we have the data we need to retrive the user names:

data <- list(PR, PR2, PR3, PR4, PR5, PR6)

users <- lapply(data, function(x) {
  vapply(x$items, function(y) {y$user$login}, character(1L))
})
users <- sort(unlist(users))

We know now that 151 has contributed through PR. Which of them are done by at the same people?

ts <- sort(table(users), decreasing = TRUE)
par(mar = c(8,3,3,0))
barplot(ts, las = 2, border = "gray", main = "Contributors to Rweekly.org")

So we have 31 contributors which are ellegible, less if we remove the current editors:

names(ts)[ts >= 6]
##  [1] "HenrikBengtsson" "Ryo-N7"          "jonmcalder"      "amrrs"          
##  [5] "tbs08"           "ColinFay"        "lgellis"         "maelle"         
##  [9] "martinctc"       "mcdussault"      "malcolmbarrett"  "moldach"        
## [13] "echasnovski"     "mailund"         "suzanbaert"      "jwijffels"      
## [17] "RaoOfPhysics"    "rpodcast"        "seabbs"          "seasmith"       
## [21] "tomroh"          "eddelbuettel"    "EmilHvitfeldt"   "katiejolly"     
## [25] "privefl"         "deanmarchiori"   "DougVegas"       "eokodie"        
## [29] "lorenzwalthert"  "mkmiecik14"      "rstub"

Reproducibility

## ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 3.6.1 (2019-07-05)
##  os       Ubuntu 19.10                
##  system   x86_64, linux-gnu           
##  ui       X11                         
##  language (EN)                        
##  collate  en_US.UTF-8                 
##  ctype    en_US.UTF-8                 
##  tz       Europe/Madrid               
##  date     2020-03-15                  
## 
## ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
##  package     * version date       lib source        
##  assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.6.0)
##  blogdown      0.18    2020-03-04 [1] CRAN (R 3.6.1)
##  bookdown      0.18    2020-03-05 [1] CRAN (R 3.6.1)
##  cli           2.0.2   2020-02-28 [1] CRAN (R 3.6.1)
##  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.6.0)
##  curl          4.3     2019-12-02 [1] CRAN (R 3.6.1)
##  digest        0.6.25  2020-02-23 [1] CRAN (R 3.6.1)
##  evaluate      0.14    2019-05-28 [1] CRAN (R 3.6.0)
##  fansi         0.4.1   2020-01-08 [1] CRAN (R 3.6.1)
##  gh          * 1.1.0   2020-01-24 [1] CRAN (R 3.6.1)
##  glue          1.3.2   2020-03-12 [1] CRAN (R 3.6.1)
##  htmltools     0.4.0   2019-10-04 [1] CRAN (R 3.6.1)
##  httr          1.4.1   2019-08-05 [1] CRAN (R 3.6.0)
##  jsonlite      1.6.1   2020-02-02 [1] CRAN (R 3.6.1)
##  knitr         1.28    2020-02-06 [1] CRAN (R 3.6.1)
##  magrittr      1.5     2014-11-22 [1] CRAN (R 3.6.0)
##  R6            2.4.1   2019-11-12 [1] CRAN (R 3.6.1)
##  Rcpp          1.0.3   2019-11-08 [1] CRAN (R 3.6.1)
##  rlang         0.4.5   2020-03-01 [1] CRAN (R 3.6.1)
##  rmarkdown     2.1     2020-01-20 [1] CRAN (R 3.6.1)
##  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.6.0)
##  stringi       1.4.6   2020-02-17 [1] CRAN (R 3.6.1)
##  stringr       1.4.0   2019-02-10 [1] CRAN (R 3.6.0)
##  withr         2.1.2   2018-03-15 [1] CRAN (R 3.6.0)
##  xfun          0.12    2020-01-13 [1] CRAN (R 3.6.1)
##  yaml          2.2.1   2020-02-01 [1] CRAN (R 3.6.1)
## 
## [1] /home/lluis/R/x86_64-pc-linux-gnu-library/3.6
## [2] /usr/local/lib/R/site-library
## [3] /usr/lib/R/site-library
## [4] /usr/lib/R/library
Avatar
Lluís Revilla Sancho
Bioinformatician

Bioinformatician with interests in functional enrichment, data integration and transcriptomics.

Related