Skip to content

Commit

Permalink
try to fix windows build error
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Nov 5, 2023
1 parent b221975 commit 5f2ee46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/fda_drugs.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ fda_drugs_file <- function(dir = faers_cache_dir("fdadrugs")) {
if (isFALSE(file)) {
file <- fda_drugs_download(dir = dir)
} else {
date <- as.Date(str_extract(file, "[\\d-]+"))
date <- as.Date(
str_extract(basename(file), "\\d+-\\d+-\\d+"),
format = "%Y-%m-%d"
)
if (length(file) > 1L) {
i <- order(date, decreasing = TRUE)[1L]
file <- file[i]
Expand Down

0 comments on commit 5f2ee46

Please sign in to comment.