Skip to content

Commit

Permalink
Return invisible NULLs
Browse files Browse the repository at this point in the history
  • Loading branch information
robjhyndman committed Feb 7, 2025
1 parent 2d94953 commit 4e51504
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions R/late.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ late_aes <- function(editor) {
articles <- articles[articles$status == "with AE", ]
if (NROW(articles) == 0L) {
warning("No articles are with AEs")
return(NULL)
return(invisible(NULL))
}
# Add stars
days <- Sys.Date() - as.Date(articles$date)
Expand All @@ -33,7 +33,7 @@ late_aes <- function(editor) {
# Return
output <- output[output$stars != "", c("id", "date", "ae", "stars")]
if(NROW(output) == 0L) {
return(NULL)
return(invisible(NULL))
} else {
return(output)
}
Expand All @@ -52,7 +52,7 @@ get_reviewers <- function(editor) {
articles <- articles[articles$status == "out for review", ]
if (NROW(articles) == 0L) {
warning("No articles are out for review")
return(NULL)
return(invisible(NULL))
} else {
articles[c("id", "reviewers")] |>
tidyr::unnest(reviewers)
Expand Down Expand Up @@ -80,7 +80,7 @@ get_reviewers <- function(editor) {
late_reviewers <- function(editor) {
reviewers <- get_reviewers(editor)
if(is.null(reviewers)) {
return(NULL)
return(invisible(NULL))
}
status <- last_reviewer_status(reviewers$comment)
invited <- status == "Invited" & !is.na(reviewers$comment)
Expand All @@ -98,7 +98,7 @@ late_reviewers <- function(editor) {
output$status <- stringr::str_extract(output$comment, "[a-zA-Z\\s]*[Agreed|Invited] [0-9]*\\-[0-9]*\\-[0-9]*$")
output <- output[output$stars != "", c("id", "name", "status", "stars")]
if(NROW(output) == 0L) {
return(NULL)
return(invisible(NULL))
} else {
return(output)
}
Expand All @@ -117,7 +117,7 @@ late_reviewers <- function(editor) {
need_reviewers <- function(editor) {
reviewers <- get_reviewers(editor)
if(is.null(reviewers)) {
return(NULL)
return(invisible(NULL))
}
reviewers <- dplyr::filter(reviewers, !is.na(reviewers$comment))
# Extract last status
Expand All @@ -129,7 +129,7 @@ need_reviewers <- function(editor) {
output <- as.data.frame(dplyr::arrange(output, n))
colnames(output) <- c("id", "number_reviewers")
if(NROW(output) == 0L) {
return(NULL)
return(invisible(NULL))
} else {
return(output)
}
Expand Down

0 comments on commit 4e51504

Please sign in to comment.