Skip to content

Commit

Permalink
add rev duration histograms to close #37
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jul 11, 2024
1 parent 0f7efd7 commit e8520df
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 8 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.2.2.048
Version: 0.2.2.049
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.2.2.048",
"version": "0.2.2.049",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
84 changes: 78 additions & 6 deletions quarto/history.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,17 @@ Review durations are displayed here in terms of two main measures:
2. *Individual Review Times*, which are the times spent by individual reviewers
on their package reviews.

Both charts are plotted against the months in which each review started, with
data slightly smoothed to aid visual display. Data for "stats" reviews may not
extend to current date, if data for the current quarter are insufficient for
statistical analyses. In these cases, data for "general" reviews are also
truncated to same length as those for "stats" reviews. Data for "all" reviews
should nevertheless always extend to the current date.
The first two of the following charts are time series charts plotted against
the months in which each review started, with data slightly smoothed to aid
visual display. Data for "stats" reviews may not extend to current date, if
data for the current quarter are insufficient for statistical analyses. In
these cases, data for "general" reviews are also truncated to same length as
those for "stats" reviews. Data for "all" reviews should nevertheless always
extend to the current date.

Following the two time series charts are two histogram plots, again for the two
distinct measures described above.


### Overall Review durations {#overall-review-durations}

Expand Down Expand Up @@ -431,10 +436,20 @@ index <- c (min (index) - 1L, index) # To ensure line joins to previous
rev_hours_gen <- rev_hours_gen [index, ]
rev_hours <- rbind (rev_hours_all, rev_hours_gen, rev_hours_stats)
# Then raw historgram data:
dat_hist <- data.frame (
year = lubridate::year (dat$opened_at),
hours = dat$review_hours,
days = dat$duration_days,
stats = dat$stats
) |>
dplyr::filter (!is.na (hours) & !is.na (days))
```

```{r ojs-in-revhours, echo = FALSE}
ojs_define (revHoursIn = rev_hours)
ojs_define (revHistIn = dat_hist)
```

```{ojs}
Expand All @@ -445,6 +460,9 @@ revHours = {
revHoursYear: new Date(row.date).getFullYear(),
}));
}
revHist = {
return transpose(revHistIn)
}
```

```{ojs}
Expand Down Expand Up @@ -487,6 +505,60 @@ Plot.plot({
})
```

### Histograms of Review Durations and Times {#review-dur-time-histograms}

The following plots are histograms of overall durations of the entire review
process (in days), followed by durations required for individual reviews (in
hours). The "Start year" filter removes all data prior to the specified year.

```{ojs}
viewof year = Inputs.range(
[minYear, maxYear],
{
step: 1,
label: "Start year",
value: minYear,
}
)
```

```{ojs}
revHistFiltered = {
return revHist.filter(d => d.year >= year);
}
```

```{ojs}
Plot.plot({
height: 300,
marginLeft: 60,
marginTop: 50,
marginBottom: 50,
y: {grid: true},
marks: [
Plot.lineY(revHistFiltered, Plot.binX({y: "count"}, {x: "days"})),
Plot.text(["Overall review durations in days"], {frameAnchor: "top", fontSize: 24, dy: -30}),
Plot.axisX({fontSize: 14, label: "", labelArrow: false, dy: 5}),
Plot.axisY({fontSize: 14, label: "", labelArrow: false}),
Plot.axisY({fontSize: 18, label: "Frequency", labelAnchor: "center", labelOffset: 55, ticks: []})
]
})
Plot.plot({
height: 300,
marginLeft: 60,
marginTop: 50,
marginBottom: 50,
y: {grid: true},
marks: [
Plot.lineY(revHistFiltered, Plot.binX({y: "count"}, {x: "hours"})),
Plot.text(["Individual review times in hours"], {frameAnchor: "top", fontSize: 24, dy: -30}),
Plot.axisX({fontSize: 14, label: "", labelArrow: false, dy: 5}),
Plot.axisY({fontSize: 14, label: "", labelArrow: false}),
Plot.axisY({fontSize: 18, label: "Frequency", labelAnchor: "center", labelOffset: 55, ticks: []})
]
})
```

## Numbers of Editors {#numbers-of-editors}

```{r get-ed-dat-history, echo = FALSE, message = FALSE}
Expand Down

0 comments on commit e8520df

Please sign in to comment.