Skip to content

Commit

Permalink
added option to only show active AEs
Browse files Browse the repository at this point in the history
  • Loading branch information
markvanderloo committed Jan 26, 2024
1 parent fde1419 commit 7ae3c67
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: rj
Title: Tools for managing the R journal
Version: 0.2.29
Version: 0.2.30
Author: Editor-in-Chief <[email protected]>
Maintainer: Editor-in-Chief <[email protected]>
Description: This package provides useful functions for the
Expand Down
17 changes: 14 additions & 3 deletions R/ae_workload.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ reviewer_summary <- function(articles, push = FALSE){
#'
#' This will examine the DESCRIPTION files for articles in
#' the Submissions folder, check articles that have status
#' "with AE".
#' "with AE".
#'
#' @param articles a tibble summary of articles in the accepted and submissions
#' folder. Output of \code{tabulate_articles()}
#' @param day_back numeric; positive number of day to go back for calculating AE
#' workload. Retains any article where any status entry for an article is
#' newer than `day_back` days ago.
#' @param active_only Toggle to show only active AEs (filtered by end year and comment field).
#'
#' @importFrom dplyr select count left_join right_join filter distinct rename bind_rows
#' @importFrom tidyr unnest replace_na
Expand All @@ -63,12 +64,22 @@ reviewer_summary <- function(articles, push = FALSE){
#' ae_workload()
#' }
#' @export
ae_workload <- function(articles = NULL, day_back = 365) {
ae_rj <- read.csv(system.file("associate-editors.csv", package = "rj")) %>%
ae_workload <- function(articles = NULL, day_back = 365, active_only=FALSE) {
# select only active AEs
ae_rj <- read.csv(system.file("associate-editors.csv", package = "rj"))

if ( isTRUE(active_only) ){
inactive <- ae_rj$end_year <= as.integer(substr(Sys.Date(),1,4)) |
grepl("Finished", ae_rj$comment, ignore.case=TRUE)
ae_rj <- ae_rj[!inactive, ]
}

ae_rj <- ae_rj %>%
select(.data$name, .data$initials, .data$email, .data$comment) %>%
as_tibble() %>%
rename(status = .data$comment)


# if don't supply articles, use documented(!) source
if (is.null(articles)) {
articles <- tabulate_articles()
Expand Down

0 comments on commit 7ae3c67

Please sign in to comment.