Skip to content

Commit

Permalink
only check doi if character
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Apr 17, 2024
1 parent fa0274f commit 6440e29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/contact_matrix.r
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contact_matrix <- function(survey, countries = NULL, survey.pop, age.limits, fil
error_string <-
"must be a survey object (created using `survey()` or `get_survey()`)"

if (all(is_doi(survey))) {
if (is_doi(survey)) {
deprecate_warn(
"0.3.2", paste0("contact_matrix(survey = '", error_string, "')"),
details = "Passing a DOI will be removed in version 0.4.0."
Expand Down
2 changes: 1 addition & 1 deletion R/download_survey.r
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,5 @@ find_common_prefix <- function(vec) {
##' @return Logical; \code{TRUE} if \code{x} is a DOI, \code{FALSE} otherwise
##' @author Sebastian Funk
is_doi <- function(x) {
is.character(x) & grepl("^10.[0-9.]{4,}/[-._;()/:A-z0-9]+$", x)
is.character(x) && grepl("^10.[0-9.]{4,}/[-._;()/:A-z0-9]+$", x)
}

0 comments on commit 6440e29

Please sign in to comment.