Skip to content

Commit c9b717f

Browse files
format mailing_lists as data.frame
1 parent a83cfe4 commit c9b717f

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

update_archives.R

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ URL_BASE ='https://stat.ethz.ch/pipermail'
55
# POSIXlt facilitates formatting as quarter
66
today = as.POSIXlt(Sys.time())
77

8-
mailing_lists = list(
9-
c(name = 'r-devel', frequency = 'month'),
10-
c(name = 'r-package-devel', frequency = 'quarter'),
11-
c(name = 'r-sig-mac', frequency = 'month'),
12-
c(name = 'r-help', frequency = 'month'),
13-
c(name = 'r-announce', frequency = 'annual'),
14-
c(name = 'r-sig-geo', frequency = 'month'),
15-
c(name = 'r-sig-finance', frequency = 'quarter'),
16-
c(name = 'r-sig-mixed-models', frequency = 'quarter')
17-
)
8+
mailing_lists = read.table(header = TRUE, text = "
9+
name frequency
10+
r-devel month
11+
r-package-devel quarter
12+
r-sig-mac month
13+
r-help month
14+
r-annouce annual
15+
r-sig-geo month
16+
r-sig-finance quarter
17+
r-sig-mixed-models quarter
18+
")
1819

19-
for (ii in seq_along(mailing_lists)) {
20-
this_list = mailing_lists[[ii]]
21-
outdir = this_list[['name']]
20+
for (ii in seq_len(nrow(mailing_lists))) {
21+
outdir = mailing_lists$name[ii]
2222

2323
URL = file.path(URL_BASE, outdir)
2424
dir.create(outdir, recursive = TRUE, showWarnings = FALSE)
2525

2626
# Always re-write current period
27-
current_period <- switch(this_list[['frequency']],
27+
current_period <- switch(mailing_lists$frequency[ii],
2828
annual = format(today, '%Y'),
2929
quarter = with(today, sprintf('%dq%d.txt', year + 1900L, mon %/% 3L + 1L)),
3030
month = format(today, '%Y-%B')

0 commit comments

Comments
 (0)