Skip to content

Commit

Permalink
delete unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
Yunuuuu committed Nov 5, 2023
1 parent 606165b commit 45392e3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
6 changes: 3 additions & 3 deletions R/counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ methods::setGeneric("faers_counts", function(object, ...) {
#' use. Only values "demo", "drug", "indi", "ther", "reac", "rpsr", and "outc"
#' can be used.
#' @param interested_event A character specify the events column(s?) in the
#' `interested_field` of object to count the unique `primaryid`. If multiple
#' columns were selected, the combination for all columns will define the
#' interested events.
#' `interested_field` data to count the unique `primaryid`. If multiple columns
#' were selected, the combination for all columns will define the interested
#' events.
#' @param interested_fn A function or formula defined the preprocessing function
#' before creating contingency table, with the `interested_field` data as the
#' input and return a [data.table][data.table::data.table].
Expand Down
20 changes: 8 additions & 12 deletions R/signal.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ methods::setMethod(
methods::setMethod(
"faers_phv_table",
c(object = "FAERSascii", interested = "FAERSascii", object2 = "missing"),
function(object, interested_event = "soc_name", ..., interested, object2) {
function(object, interested_field = "reac", interested_event = "soc_name", ..., interested, object2) {
if (!object@standardization) {
cli::cli_abort("{.arg object} must be standardized using {.fn faers_standardize}")
}
Expand All @@ -86,9 +86,12 @@ methods::setMethod(
}
full_counts <- faers_counts(
object,
interested_field = interested_field,
interested_event = interested_event, ...
)
interested_counts <- faers_counts(interested,
interested_counts <- faers_counts(
interested,
interested_field = interested_field,
interested_event = interested_event, ...
)
n <- sum(full_counts$N) # scalar
Expand All @@ -114,7 +117,7 @@ methods::setMethod(
methods::setMethod(
"faers_phv_table",
c(object = "FAERSascii", interested = "missing", object2 = "FAERSascii"),
function(object, interested_event = "soc_name", ..., interested, object2) {
function(object, interested_field = "reac", interested_event = "soc_name", ..., interested, object2) {
if (!object@standardization) {
cli::cli_abort("{.arg object} must be standardized using {.fn faers_standardize}")
}
Expand All @@ -128,9 +131,11 @@ methods::setMethod(
cli::cli_warn("{.val {overlapped_idx}} report{?s} are overlapped between {.arg object} and {.arg object2}")
}
interested_counts <- faers_counts(object,
interested_field = interested_field,
interested_event = interested_event, ...
)
interested_counts2 <- faers_counts(object2,
interested_field = interested_field,
interested_event = interested_event, ...
)
n1. <- sum(interested_counts$N)
Expand All @@ -151,15 +156,6 @@ methods::setMethod(

utils::globalVariables(c("a", "b", "d", "n.1"))

#' @rdname faers_phv_signal
methods::setMethod(
"faers_phv_table",
c(object = "FAERSascii", interested = "FAERSascii", object2 = "FAERSascii"),
function(object, interested, object2) {
cli::cli_abort("{.arg interested} and {.arg object2} are both exclusive, must be provided only one or none")
}
)

##############################################################
#' @export
#' @rdname faers_phv_signal
Expand Down
6 changes: 3 additions & 3 deletions man/faers_counts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions man/faers_phv_signal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 45392e3

Please sign in to comment.