Skip to content

Commit

Permalink
add plot of review duration for #7
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Mar 20, 2024
1 parent a98af72 commit 6ddddf4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dashboard
Title: What the Package Does (One Line, Title Case)
Version: 0.0.10.001
Version: 0.0.10.002
Authors@R:
person(given = "First",
family = "Last",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "dashboard: What the Package Does (One Line, Title Case)",
"codeRepository": "https://github.com/ropensci-review-tools/dashboard",
"license": "https://spdx.org/licenses/MIT",
"version": "0.0.10.001",
"version": "0.0.10.002",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
30 changes: 27 additions & 3 deletions quarto/history.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ software review, which started in September 2021.
# Convert opened/closed dates to monthly sequence This is adapted from the editors
# timeline code in R/editors.R.
get_monthly_reviews <- function (dat) {
index <- which (!is.na (dat$closed_at))
month_seqs <- lapply (seq_along (index), function (i) {
s <- seq (dat$opened_at [index [i]], dat$closed_at [index [i]], by = "1 month")
dat$closed_at [which (is.na (dat$closed_at))] <- Sys.Date ()
month_seqs <- lapply (seq_len (nrow (dat)), function (i) {
s <- seq (dat$opened_at [i], dat$closed_at [i], by = "1 month")
format (s, "%Y-%m")
})
month_seq_table <- table (unlist (month_seqs))
Expand Down Expand Up @@ -61,3 +61,27 @@ ggplot (reviews, aes (x = month, y = reviews, colour = type)) +
legend.position.inside = c (0.9, 0.8)
)
```

The next chart shows the average duration of the review process, plotted
against the months in which each review started.

```{r rev-duration, echo = FALSE}
rev_dur <- data.frame (
quarter = lubridate::quarter (dat$opened_at, type = "date_first"),
duration = dat$duration_days * 12 / 365
) |>
dplyr::group_by (quarter) |>
dplyr::summarise (dur = mean (duration, na.rm = TRUE))
```

```{r rev-duration-plot, echo = FALSE}
ggplot (rev_dur, aes (x = quarter, y = dur)) +
geom_line () +
theme_minimal () +
xlab ("Year") +
ylab ("Duration (months)") +
theme (
legend.position = "inside",
legend.position.inside = c (0.9, 0.8)
)
```

0 comments on commit 6ddddf4

Please sign in to comment.