Skip to content

Commit

Permalink
Have person() warn about invalid ORCID iDs (suggestion by AZ).
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87147 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Sep 13, 2024
1 parent 7d1b0a9 commit 9f1a1c0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/library/utils/R/citation.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ function(given = NULL, family = NULL, middle = NULL,
else
names(comment)[ind] <- "ORCID"
}
if(any(ind <- (names(comment) == "ORCID"))) {
ids <- comment[ind]
bad <- which(!tools:::.ORCID_iD_is_valid(ids))
if(length(bad)) {
warning(sprintf(ngettext(length(bad),
"Invalid ORCID iD: %s.",
"Invalid ORCID iDs: %s."),
paste(sQuote(ids[bad]),
collapse = ", ")),
domain = NA)
}
}
}

rval <- list(given = given, family = family, role = role,
Expand Down

0 comments on commit 9f1a1c0

Please sign in to comment.