Skip to content

Commit be33aaa

Browse files
Fully deprecate frollapply(x=, n=) (#7530)
* Cycle deprecation of frollapply(x=, n=) * cycle deprecation tests --------- Co-authored-by: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com>
1 parent 45f8a12 commit be33aaa

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

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

11+
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`.
12+
1113
### Notes
1214

1315
1. {data.table} now depends on R 3.5.0 (2018).

R/frollapply.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,10 @@ fixselfref = function(x) {
127127

128128
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) {
129129
if (!missing(x)) {
130-
warningf("'x' is deprecated in frollapply, use 'X' instead")
131-
X = x
130+
stopf("'x' is deprecated in frollapply, use 'X' instead")
132131
}
133132
if (!missing(n)) {
134-
warningf("'n' is deprecated in frollapply, use 'N' instead")
135-
N = n
133+
stopf("'n' is deprecated in frollapply, use 'N' instead")
136134
}
137135
if (!isTRUEorFALSE(by.column))
138136
stopf("'by.column' must be TRUE or FALSE")

inst/tests/froll.Rraw

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,9 +1944,9 @@ test(6010.542, frollapply(1:2, 2, sum, adaptive=NA), error="must be TRUE or FALS
19441944
test(6010.543, frollapply(1:2, 2, sum, partial=NA), error="must be TRUE or FALSE")
19451945
test(6010.544, frollapply(1:2, 2, sum, give.names=NA), error="must be TRUE or FALSE")
19461946
test(6010.545, frollapply(1:2, 2, sum, simplify=NA), error="must be TRUE or FALSE or a function")
1947-
test(6010.561, frollapply(x=1:2, N=2, FUN=sum), c(NA,3L), warning="'x' is deprecated in frollapply, use 'X' instead")
1948-
test(6010.562, frollapply(X=1:2, n=2, FUN=sum), c(NA,3L), warning="'n' is deprecated in frollapply, use 'N' instead")
1949-
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"))
1947+
test(6010.561, frollapply(x=1:2, N=2, FUN=sum), error="'x' is deprecated in frollapply, use 'X' instead")
1948+
test(6010.562, frollapply(X=1:2, n=2, FUN=sum), error="'n' is deprecated in frollapply, use 'N' instead")
1949+
# 6010.563 tested both x= and n= resulting in 2 warnings, but with errors, that's not very useful.
19501950
test(6010.564, frollapply(1:2, c("a","a"), length, adaptive=TRUE), error="'N' must be an integer vector or list of integer vectors")
19511951
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")
19521952
test(6010.566, frollapply(1:2, 2, length, by.column=FALSE), error="frollapply by.column=FALSE requires 'X' argument to be")

0 commit comments

Comments
 (0)