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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

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`.

2. `x` and `n` arguments to `frollapply` functions no longer work. Use `X` and `N` instead, respectively; see the release note for 1.18.0, item 4 under `BREAKING CHANGE`.

### Notes

1. {data.table} now depends on R 3.5.0 (2018).
Expand Down
6 changes: 2 additions & 4 deletions R/frollapply.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,10 @@ fixselfref = function(x) {

frollapply = function(X, N, FUN, ..., by.column=TRUE, fill=NA, align=c("right","left","center"), adaptive=FALSE, partial=FALSE, give.names=FALSE, simplify=TRUE, x, n) {
if (!missing(x)) {
warningf("'x' is deprecated in frollapply, use 'X' instead")
X = x
stopf("'x' is deprecated in frollapply, use 'X' instead")
}
if (!missing(n)) {
warningf("'n' is deprecated in frollapply, use 'N' instead")
N = n
stopf("'n' is deprecated in frollapply, use 'N' instead")
}
if (!isTRUEorFALSE(by.column))
stopf("'by.column' must be TRUE or FALSE")
Expand Down
6 changes: 3 additions & 3 deletions inst/tests/froll.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -1944,9 +1944,9 @@ test(6010.542, frollapply(1:2, 2, sum, adaptive=NA), error="must be TRUE or FALS
test(6010.543, frollapply(1:2, 2, sum, partial=NA), error="must be TRUE or FALSE")
test(6010.544, frollapply(1:2, 2, sum, give.names=NA), error="must be TRUE or FALSE")
test(6010.545, frollapply(1:2, 2, sum, simplify=NA), error="must be TRUE or FALSE or a function")
test(6010.561, frollapply(x=1:2, N=2, FUN=sum), c(NA,3L), warning="'x' is deprecated in frollapply, use 'X' instead")
test(6010.562, frollapply(X=1:2, n=2, FUN=sum), c(NA,3L), warning="'n' is deprecated in frollapply, use 'N' instead")
test(6010.563, frollapply(x=1:2, n=2, FUN=sum), c(NA,3L), warning=c("'x' is deprecated in frollapply, use 'X' instead","'n' is deprecated in frollapply, use 'N' instead"))
test(6010.561, frollapply(x=1:2, N=2, FUN=sum), error="'x' is deprecated in frollapply, use 'X' instead")
test(6010.562, frollapply(X=1:2, n=2, FUN=sum), error="'n' is deprecated in frollapply, use 'N' instead")
# 6010.563 tested both x= and n= resulting in 2 warnings, but with errors, that's not very useful.
test(6010.564, frollapply(1:2, c("a","a"), length, adaptive=TRUE), error="'N' must be an integer vector or list of integer vectors")
test(6010.565, frollapply(1:2, list(c("a","a")), length, adaptive=TRUE), error="'N' must be an integer vector or list of integer vectors")
test(6010.566, frollapply(1:2, 2, length, by.column=FALSE), error="frollapply by.column=FALSE requires 'X' argument to be")
Expand Down
Loading