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] 706

We know that there have been 552, we’ll need 8 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 171 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 34 contributors which are ellegible, less if we remove the current editors:

names(ts)[ts >= 6]
##  [1] "Ryo-N7"          "HenrikBengtsson" "martinctc"       "maelle"         
##  [5] "amrrs"           "jwijffels"       "lgellis"         "mcdussault"     
##  [9] "malcolmbarrett"  "moldach"         "dA505819"        "echasnovski"    
## [13] "jonmcalder"      "jonocarroll"     "mailund"         "suzanbaert"     
## [17] "seabbs"          "feddelegrand7"   "hfshr"           "lorenzwalthert" 
## [21] "MilesMcBain"     "RaoOfPhysics"    "tomroh"          "EmilHvitfeldt"  
## [25] "katiejolly"      "privefl"         "rCarto"          "deanmarchiori"  
## [29] "DougVegas"       "eokodie"         "jdblischak"      "mkmiecik14"     
## [33] "noamross"        "rstub"

Reproducibility

## ─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 4.0.1 (2020-06-06)
##  os       Ubuntu 20.04.1 LTS          
##  system   x86_64, linux-gnu           
##  ui       X11                         
##  language (EN)                        
##  collate  en_US.UTF-8                 
##  ctype    en_US.UTF-8                 
##  tz       Europe/Madrid               
##  date     2021-01-08                  
## 
## ─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
##  package     * version date       lib source                           
##  assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.0.1)                   
##  blogdown      0.21.84 2021-01-07 [1] Github (rstudio/blogdown@c4fbb58)
##  bookdown      0.21    2020-10-13 [1] CRAN (R 4.0.1)                   
##  cli           2.2.0   2020-11-20 [1] CRAN (R 4.0.1)                   
##  crayon        1.3.4   2017-09-16 [1] CRAN (R 4.0.1)                   
##  curl          4.3     2019-12-02 [1] CRAN (R 4.0.1)                   
##  digest        0.6.27  2020-10-24 [1] CRAN (R 4.0.1)                   
##  evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.1)                   
##  fansi         0.4.1   2020-01-08 [1] CRAN (R 4.0.1)                   
##  gh          * 1.2.0   2020-11-27 [1] CRAN (R 4.0.1)                   
##  gitcreds      0.1.1   2020-12-04 [1] CRAN (R 4.0.1)                   
##  glue          1.4.2   2020-08-27 [1] CRAN (R 4.0.1)                   
##  htmltools     0.5.0   2020-06-16 [1] CRAN (R 4.0.1)                   
##  httr          1.4.2   2020-07-20 [1] CRAN (R 4.0.1)                   
##  jsonlite      1.7.2   2020-12-09 [1] CRAN (R 4.0.1)                   
##  knitr         1.30    2020-09-22 [1] CRAN (R 4.0.1)                   
##  magrittr      2.0.1   2020-11-17 [1] CRAN (R 4.0.1)                   
##  R6            2.5.0   2020-10-28 [1] CRAN (R 4.0.1)                   
##  rlang         0.4.10  2020-12-30 [1] CRAN (R 4.0.1)                   
##  rmarkdown     2.6     2020-12-14 [1] CRAN (R 4.0.1)                   
##  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.1)                   
##  stringi       1.5.3   2020-09-09 [1] CRAN (R 4.0.1)                   
##  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.0.1)                   
##  withr         2.3.0   2020-09-22 [1] CRAN (R 4.0.1)                   
##  xfun          0.20    2021-01-06 [1] CRAN (R 4.0.1)                   
##  yaml          2.2.1   2020-02-01 [1] CRAN (R 4.0.1)                   
## 
## [1] /home/lluis/bin/R/4.0.1/lib/R/library

Edit this page

Avatar
Lluís Revilla Sancho
Data scientist

Data scientist with interests in software quality, mostly R.

Related