A ‘long vector’ is a vector with more than
\(2^31 - 1\) elements (the largest possible 32-bit integer).
Long vectors are supported in R on 64-bit computer systems.
This feature was introduced in R version 3.0.0.
Although long vectors are permitted, not all functions in R
have been extended to handle long vectors.
The base R function diff currently does not handle
a long vector, and may cause the entire R
session to be terminated.
The function difflong is a temporary replacement
for diff in the simplest case:
difflong(x) is a replacement for diff(x).
If drop=TRUE (the default),
the result of difflong(x) is equivalent to diff(x),
a vector with length equal to length(x) - 1.
If drop=FALSE the result of difflong(x, FALSE) has the
same length as x; the first entry is zero, and the subsequent
entries are equivalent to diff(x).