Commit 469ff923 authored by Martin Maechler's avatar Martin Maechler
Browse files

"optimize" .diff.big(): do not create 'r'

parent d19b5b35
......@@ -24,16 +24,16 @@ setOldClass("bigq")#, prototype=as.bigq(integer()))
stop("'lag' and 'differences' must be integers >= 1")
if (lag * differences >= xlen)
return(x[0L]) # empty, but of proper mode
r <- x ##>> r <- unclass(x) # don't want class-specific subset methods
##>> r <- unclass(x) # don't want class-specific subset methods
i1 <- -seq_len(lag)
if (ismat)
for (i in seq_len(differences))
r <- r[i1, , drop = FALSE] -
r[-nrow(r):-(nrow(r)-lag+1L), , drop = FALSE]
x <- x[i1, , drop = FALSE] -
x[-nrow(x):-(nrow(x)-lag+1L), , drop = FALSE]
else
for (i in seq_len(differences))
r <- r[i1] - r[-length(r):-(length(r)-lag+1L)]
##>> class(r) <- oldClass(x)
r
x <- x[i1] - x[-length(x):-(length(x)-lag+1L)]
##>> class(r) <- oldClass(x)
x
}
##--> and entries in ../NAMESPACE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment