diff --git a/R/faers.R b/R/faers.R index 7dced57..d864486 100644 --- a/R/faers.R +++ b/R/faers.R @@ -11,6 +11,8 @@ faers <- function(years, quarters, format = NULL, dir = getwd(), compress_dir = dir, handle_opts = list()) { format <- match.arg(format, faers_file_format) yq <- recycle_scalar(years = years, quarters = quarters) + data.table::setDT(yq) + yq <- unique(yq) faers_files <- do.call(faers_download, c( yq, list(format = format, dir = dir), handle_opts )) diff --git a/tests/testthat/test_faers.R b/tests/testthat/test_faers.R index 2e9cfcb..f56d915 100644 --- a/tests/testthat/test_faers.R +++ b/tests/testthat/test_faers.R @@ -12,6 +12,12 @@ testthat::test_that("faers() function works as expected", { dir = internal_file("extdata"), compress_dir = tempdir() )) + testthat::expect_no_error(data3 <- faers( + rep(c(2004, 2017), each = 2L), + rep(c("q1", "q2"), each = 2L), "ascii", + dir = internal_file("extdata"), + compress_dir = tempdir() + )) testthat::expect_s4_class(data3, "FAERSascii") testthat::expect_false(data3@deduplication) testthat::expect_false(data3@standardization)