Skip to content

Commit

Permalink
Updated late_reviewers to distinguish late acceptance from late reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Feb 5, 2025
1 parent 55b91f6 commit 5196777
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
27 changes: 17 additions & 10 deletions R/late_reviewers.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
#'
#' @param editor The editor or associate editor handling the submissions
#'
#' @return A data frame of reviewers who have not submitted their review on time.
#' 1 star: invited more than 6 weeks ago;
#' 2 stars: invited more than 12 weeks ago;
#' 3 stars: invited more than 18 weeks ago.
#' @return A data frame of reviewers who have not responded or not submitted their review on time.
#' @details The number of stars has the following meaning:
#' \itemize{
#' \item 1 star: not responded in more than a week or accepted more than 4 weeks ago;
#' \item 2 stars: not responded in more than 2 weeks or accepted more than 8 weeks ago;
#' \item 3 stars: not responded in more than 3 weeks or accepted more than 12 weeks ago;
#' }
#' Please chase up late reviewers.
#' If a reviewer has declined, use \code{\link{decline_reviewer}} to remove them from the list.
#' If you have decided to abandon a reviewer, use \code{\link{abandon_reviewer}}.
Expand All @@ -23,14 +26,18 @@ late_reviewers <- function(editor) {
}
reviewers <- articles[c("id", "reviewers")] |>
tidyr::unnest(reviewers)
active <- stringr::str_detect(reviewers$comment,".*Invited [0-9]*\\-[0-9]*\\-[0-9]*$") &
invited <- stringr::str_detect(reviewers$comment,".*Invited [0-9]*\\-[0-9]*\\-[0-9]*$") &
!is.na(reviewers$comment)
output <- dplyr::arrange(reviewers[active,], comment)
date_invited <- stringr::str_extract(output$comment, "[0-9]*\\-[0-9]*\\-[0-9]*") |>
agreed <- stringr::str_detect(reviewers$comment,".*Agreed [0-9]*\\-[0-9]*\\-[0-9]*$") &
!is.na(reviewers$comment)
output <- dplyr::arrange(reviewers[invited | agreed,], comment)
invited <- invited[invited | agreed]
dates <- stringr::str_extract(output$comment, "[0-9]*\\-[0-9]*\\-[0-9]*$") |>
as.Date()
days <- Sys.Date() - date_invited
deadlines <- c(6L, 12L, 18L) * 7
stars <- unlist(lapply(days, function(u) sum(u > deadlines)))
days <- Sys.Date() - dates
agreed_stars <- unlist(lapply(days, function(u) sum(u > c(4L, 8L, 12L) * 7)))
invited_stars <- unlist(lapply(days, function(u) sum(u > c(7L, 14L, 21L))))
stars <- invited_stars * invited + agreed_stars * !invited
output$stars <- stringr::str_dup("*", stars)
return(output[stars > 0,])
}
19 changes: 12 additions & 7 deletions man/late_reviewers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5196777

Please sign in to comment.