Skip to content

Commit 029c5af

Browse files
committed
use new argument name N
1 parent 2370719 commit 029c5af

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

man/frollapply.Rd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,25 @@
4848
\item An optimization used to avoid repeated allocation of window subsets (explained more deeply in \emph{Implementation} section below) may, in special cases, return rather surprising results:
4949
\preformatted{
5050
setDTthreads(1)
51-
frollapply(c(1, 9), n=1L, FUN=identity) ## unexpected
51+
frollapply(c(1, 9), N=1L, FUN=identity) ## unexpected
5252
#[1] 9 9
53-
frollapply(c(1, 9), n=1L, FUN=list) ## unexpected
53+
frollapply(c(1, 9), N=1L, FUN=list) ## unexpected
5454
# V1
5555
# <num>
5656
#1: 9
5757
#2: 9
5858
setDTthreads(2)
59-
frollapply(c(1, 9), n=1L, FUN=identity) ## good only because threads >= input
59+
frollapply(c(1, 9), N=1L, FUN=identity) ## good only because threads >= input
6060
#[1] 1 9
61-
frollapply(c(1, 5, 9), n=1L, FUN=identity) ## unexpected again
61+
frollapply(c(1, 5, 9), N=1L, FUN=identity) ## unexpected again
6262
#[1] 5 5 9
6363
}
6464
Problem occurs, in rather unlikely scenarios for rolling computations, when objects returned from a function can be its input (i.e. \code{identity}), or a reference to it (i.e. \code{list}), then one has to add extra \code{copy} call:
6565
\preformatted{
6666
setDTthreads(1)
67-
frollapply(c(1, 9), n=1L, FUN=function(x) copy(identity(x))) ## only 'copy' would be equivalent here
67+
frollapply(c(1, 9), N=1L, FUN=function(x) copy(identity(x))) ## only 'copy' would be equivalent here
6868
#[1] 1 9
69-
frollapply(c(1, 9), n=1L, FUN=function(x) copy(list(x)))
69+
frollapply(c(1, 9), N=1L, FUN=function(x) copy(list(x)))
7070
# V1
7171
# <num>
7272
#1: 1

0 commit comments

Comments
 (0)