From a28b994ce8142be6e1de362475d7aba450fdc0ea Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 26 Dec 2025 10:26:18 -0800 Subject: [PATCH 1/3] fully deprecate hasNA --- R/froll.R | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/R/froll.R b/R/froll.R index b2ca428f5..e4db9454b 100644 --- a/R/froll.R +++ b/R/froll.R @@ -152,12 +152,7 @@ frolladapt = function(x, n, align="right", partial=FALSE, give.names=FALSE) { froll = function(fun, x, n, fill=NA, algo=c("fast","exact"), align=c("right","left","center"), na.rm=FALSE, has.nf=NA, adaptive=FALSE, partial=FALSE, give.names=FALSE, hasNA) { stopifnot(!missing(fun), is.character(fun), length(fun)==1L, !is.na(fun)) - if (!missing(hasNA)) { - if (!is.na(has.nf)) - stopf("hasNA is deprecated, use has.nf instead") - warningf("hasNA is deprecated, use has.nf instead") - has.nf = hasNA - } # remove check on next major release + if (!missing(hasNA)) stopf("hasNA is deprecated, use has.nf instead") algo = match.arg(algo) align = match.arg(align) if (isTRUE(give.names)) { From 2611faf6e3d4f9fc4cf9e91a41fa46840e2a7a2c Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 26 Dec 2025 10:27:54 -0800 Subject: [PATCH 2/3] NEWS --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 28ef53c51..92d818186 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,10 @@ ## data.table [v1.18.99](https://github.com/Rdatatable/data.table/milestone/37?closed=1) (in development) +### BREAKING CHANGE + +1. `hasNA` argument to `froll*` functions no longer works. Use `has.nf` instead; see the release note for 1.18.0, item 3 under `BREAKING CHANGE`. + ### Notes 1. {data.table} now depends on R 3.5.0 (2018). From 399421e87ab3c0316b0aa0d2af561e567d22d91b Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 26 Dec 2025 10:38:12 -0800 Subject: [PATCH 3/3] cycle deprecation tests --- inst/tests/froll.Rraw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/tests/froll.Rraw b/inst/tests/froll.Rraw index 489afcdad..b41f4ce99 100644 --- a/inst/tests/froll.Rraw +++ b/inst/tests/froll.Rraw @@ -825,8 +825,8 @@ test(6000.190, frollmean(c(1:2,NA,4:10), rep(4L,10), adaptive=TRUE, has.nf=FALSE test(6000.191, frollmean(c(1:2,NA,4:10), rep(2L,10), adaptive=TRUE, has.nf=FALSE), c(NA, 1.5, NA, NA, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning") test(6000.192, frollmean(c(1:2,NA,4:10), rep(4L,10), adaptive=TRUE, has.nf=FALSE, algo="exact"), c(rep(NA_real_, 6), 5.5, 6.5, 7.5, 8.5), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning") test(6000.193, frollmean(c(1:2,NA,4:10), rep(2L,10), adaptive=TRUE, has.nf=FALSE, algo="exact"), c(NA, 1.5, NA, NA, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5), warning="has.nf=FALSE used but non-finite values are present in input, use default has.nf=NA to avoid this warning") -test(6000.199, frollmean(1:2, 1, hasNA=TRUE), c(1,2), warning="hasNA is deprecated, use has.nf instead") -test(6000.1991, frollmean(1:2, 1, has.nf=FALSE, hasNA=TRUE), error="hasNA is deprecated, use has.nf instead") +test(6000.199, frollmean(1:2, 1, hasNA=TRUE), error="hasNA is deprecated, use has.nf instead") +# 6000.1991 tested supplying has.nf and hasNA, no longer makes sense ## frollsum x = 1:6/2