-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdutch_emails.R
45 lines (35 loc) · 1.12 KB
/
dutch_emails.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
library("magrittr")
library("stringr")
library("purrr")
library("dplyr")
# load the CRAN pkg db
cran <- tools::CRAN_package_db()
# get only cols of interest, remove orphaned pkgs
cols_of_interest <-
c(
"Package", "Description",
"Author", "Maintainer", "URL",
"Date", "Packaged", "Published"
)
cran <- cran[cran$Maintainer != "ORPHANED", cols_of_interest]
# maintainers, remove pesky < >
maintainers <- stringr::str_extract(cran$Maintainer, "<.*>")
maintainers <-
maintainers %>%
stringr::str_replace("<", "") %>%
stringr::str_replace(">", "")
# get the domains from maintainer emails
doms <-
maintainers %>%
strsplit("@") %>%
map_chr(2L) %>%
strsplit("\\.") %>%
map_chr(~ last(.))
# which ones are 100% dutch ?
dutchies <- grepl("nl", doms)
# omg omg omg look at all this meetup material :-)
sprintf("hey there are %d dutch pkgs on cran! sooo many meetups :-) ", sum(dutchies))
dutch_pkgs <- cran[which(dutchies), ]
# from the several datetime columns "Packaged"/"Published"
# seem most reliable
dutch_pkgs <- arrange(dutch_pkgs, desc(Packaged))