@@ -3901,6 +3901,17 @@ function(aar, strict = FALSE)
39013901 if (length(ids ))
39023902 out $ bad_authors_at_R_field_has_persons_with_dup_ORCID_identifiers <-
39033903 ids
3904+ ids <- .ROR_ID_from_person(aar )
3905+ pos <- which(! is.na(ids ))
3906+ ids <- ids [pos ]
3907+ pos <- pos [! .ROR_ID_is_valid(ids )]
3908+ if (length(pos ))
3909+ out $ bad_authors_at_R_field_has_persons_with_bad_ROR_identifiers <-
3910+ format(aar [pos ])
3911+ ids <- ids [duplicated(ids )]
3912+ if (length(ids ))
3913+ out $ bad_authors_at_R_field_has_persons_with_dup_ROR_identifiers <-
3914+ ids
39043915 }
39053916 if (strict > = 3L ) {
39063917 non_standard_roles <-
@@ -4007,7 +4018,15 @@ function(x)
40074018 if (length(bad <- x [[" bad_authors_at_R_field_has_persons_with_dup_ORCID_identifiers" ]])) {
40084019 c(gettext(" Authors@R field gives persons with duplicated ORCID identifiers:" ),
40094020 paste0(" " , bad ))
4010- }
4021+ },
4022+ if (length(bad <- x [[" bad_authors_at_R_field_has_persons_with_bad_ROR_identifiers" ]])) {
4023+ c(gettext(" Authors@R field gives persons with invalid ROR identifiers:" ),
4024+ paste0(" " , bad ))
4025+ },
4026+ if (length(bad <- x [[" bad_authors_at_R_field_has_persons_with_dup_ROR_identifiers" ]])) {
4027+ c(gettext(" Authors@R field gives persons with duplicated ROR identifiers:" ),
4028+ paste0(" " , bad ))
4029+ }
40114030 )
40124031}
40134032
@@ -8203,6 +8222,20 @@ function(dir, localOnly = FALSE, pkgSize = NA)
82038222 if (length(pos ))
82048223 out $ bad_ORCID_iDs <- odb [pos , , drop = FALSE ]
82058224 }
8225+ # # Also check ROR IDs.
8226+ rdb <- .ROR_ID_db_from_package_sources(dir )
8227+ if (NROW(rdb )) {
8228+ # # Only look at things that may be valid: the others are
8229+ # # complained about elsewhere.
8230+ ind <- grepl(.ROR_ID_variants_regexp , rdb [, 1L ])
8231+ rdb <- rdb [ind , , drop = FALSE ]
8232+ }
8233+ if (NROW(rdb ) && requireNamespace(" curl" , quietly = TRUE )) {
8234+ ids <- .ROR_ID_canonicalize(rdb [, 1L ])
8235+ pos <- which(! .ROR_ID_is_alive(ids ))
8236+ if (length(pos ))
8237+ out $ bad_ROR_IDs <- rdb [pos , , drop = FALSE ]
8238+ }
82068239 }
82078240 }
82088241
@@ -8984,6 +9017,17 @@ function(x, ...)
89849017 collapse = " , " ))),
89859018 collapse = " \n " )
89869019 }),
9020+ fmt(if (length(y <- x $ bad_ROR_IDs )) {
9021+ paste(c(if (NROW(y ) > 1L )
9022+ " Found the following (possibly) invalid ROR IDs:"
9023+ else
9024+ " Found the following (possibly) invalid ROR IDs:" ,
9025+ sprintf(" ID: %s\t (from: %s)" ,
9026+ unlist(y [, 1L ]),
9027+ vapply(y [, 2L ], paste , " " ,
9028+ collapse = " , " ))),
9029+ collapse = " \n " )
9030+ }),
89879031 fmt(if (length(y <- x $ encoding ))
89889032 c(sprintf(" Package encoding '%s' is deprecated." , y ),
89899033 " Please change to UTF-8 for non-ASCII content." )),
0 commit comments