Skip to content

Commit

Permalink
remove duplicated periods
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Nov 7, 2023
1 parent 2b31264 commit 2263b11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/faers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
))
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test_faers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2263b11

Please sign in to comment.