Skip to content

Commit a4dc30f

Browse files
sbfnksbfnk-bot
andcommitted
Filter out old re-deposited papers from publication suggestions
Only include papers published in current or previous year to avoid Crossref returning old papers that were recently re-indexed. Co-Authored-By: sbfnk-bot <sbfnk-bot@users.noreply.github.com>
1 parent a666f01 commit a4dc30f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

_automation/get_new_papers.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ get_new_papers_orcid <- function(orcid, from_date) {
2323
type
2424
)
2525
) |>
26-
dplyr::filter(type == "journal-article")
26+
dplyr::filter(type == "journal-article") |>
27+
## filter out old papers that were re-deposited
28+
dplyr::mutate(
29+
pub_year = as.numeric(format(
30+
lubridate::parse_date_time(issued, c("Y-m-d", "Y-m", "Y")), "%Y"
31+
))
32+
) |>
33+
dplyr::filter(pub_year >= as.numeric(format(Sys.Date(), "%Y")) - 1) |>
34+
dplyr::select(-pub_year)
2735
existing_papers <- dois_from_bib("_data/papers.bib")
2836
refs <- refs |>
2937
dplyr::filter(!(doi %in% existing_papers))

0 commit comments

Comments
 (0)