From e5e1bdf9938a60cead6895dd28054edb8c214e1d Mon Sep 17 00:00:00 2001 From: emse-p4a-gwu Date: Sun, 10 Dec 2023 14:58:56 -0500 Subject: [PATCH] updated how featured articles are handled --- R/functions.R | 7 ++++++- research.Rmd | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/R/functions.R b/R/functions.R index 3f0f0842..c6e22d7c 100644 --- a/R/functions.R +++ b/R/functions.R @@ -85,8 +85,13 @@ make_media_list <- function() { return(paste(temp$post, collapse = "\n")) } -make_pub_list <- function(pubs, category) { +make_pub_list <- function(pubs, category, featured = FALSE) { x <- pubs[which(pubs$category == category),] + if (featured) { + x <- x[which(x$featured),] + } else { + x <- x[which(!x$featured),] + } pub_list <- lapply(split(x, 1:nrow(x)), make_pub) return(paste(unlist(pub_list), collapse = "")) } diff --git a/research.Rmd b/research.Rmd index 2cb0d767..178345ed 100644 --- a/research.Rmd +++ b/research.Rmd @@ -44,7 +44,7 @@ pubs <- get_pubs() -`r make_pub_list(pubs, "featured")` +`r make_pub_list(pubs, "peer_reviewed", featured = TRUE)` ## Other Peer-Reviewed Publications