Skip to content

Commit

Permalink
smooth rev-dur graph for #7
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Mar 20, 2024
1 parent 483bf89 commit fdedcca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 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.004
Version: 0.0.10.005
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.004",
"version": "0.0.10.005",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
24 changes: 17 additions & 7 deletions quarto/history.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,18 @@ reviews <- rbind (monthly_reviews, monthly_reviews_gen, monthly_reviews_stats)
```{r plot-review-history, echo = FALSE}
ggplot (reviews, aes (x = month, y = reviews, colour = type)) +
geom_line (linetype = reviews$lty) +
xlab ("Year") +
ylab ("Nr. active reviews / month") +
theme_minimal () +
theme (
legend.position = "inside",
legend.position.inside = c (0.9, 0.8)
legend.position.inside = c (0.1, 0.8)
)
```

The next chart shows the average duration of the review process, plotted
against the months in which each review started.
against the months in which each review started. (The data have been slightly
smoothed to aid visual display.)

```{r rev-duration, echo = FALSE}
rev_dur <- data.frame (
Expand All @@ -72,16 +75,23 @@ rev_dur <- data.frame (
) |>
dplyr::group_by (quarter) |>
dplyr::summarise (dur = mean (duration, na.rm = TRUE))
# Those quarterly data are quite jumpy, so apply a filter:
filter_dat <- function (dat, flen = 5) {
index <- seq_len (length (dat) - flen + 1) + floor (flen / 2)
x <- seq_len (flen) - ceiling (flen / 2)
x <- -abs (x)
filt <- exp (x)
filt <- filt / sum (filt)
dat [index] <- filter (dat, filt) [index]
return (dat)
}
rev_dur$dur <- filter_dat (rev_dur$dur, flen = 3)
```

```{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)
)
ylab ("Review Duration (months)")
```

0 comments on commit fdedcca

Please sign in to comment.