Skip to content

Commit

Permalink
fix: work around data.table warning
Browse files Browse the repository at this point in the history
  • Loading branch information
TimTaylor committed May 16, 2024
1 parent a19f87d commit ba076a1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/incidence.R
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ incidence <- function(
...
) {

..counts <- NULL

# handle defunct arguments
if (...length()) {
if (getRversion() >= "4.1.0") {
Expand Down Expand Up @@ -367,7 +365,7 @@ incidence <- function(
res <- DT[, .N, keyby = c(date_names_to, groups, count_names_to)]
setnames(res, length(res), count_values_to)
} else {
nas_present <- sapply(DT[,..counts], anyNA)
nas_present <- sapply(.subset(DT,counts), anyNA)
if (any(nas_present)) {
missing_names <- names(nas_present)[nas_present]
warnf(
Expand Down

0 comments on commit ba076a1

Please sign in to comment.