Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
7 changes: 1 addition & 6 deletions R/froll.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions inst/tests/froll.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading