do_call_rbind | R Documentation |
rbind
’ a list of objects, such as xts time
series.Recursively ‘rbind
’ a list of objects, such as xts time
series.
do_call_rbind(listv)
listv |
A list of objects, such as vectors, matrices, data frames, or time series. |
Performs lapply loop, each time binding neighboring elements and
dividing the length of listv
by half. The result of performing
do_call_rbind(list_xts)
on a list of xts time series is
identical to performing do.call(rbind, list_xts)
. But
do.call(rbind, list_xts)
is very slow, and often causes an
‘out of memory’ error.
The function do_call_rbind()
performs the same operation as
do.call(rbind, listv)
, but using recursion, which is much faster and
uses less memory. This is the same function as
‘do.call.rbind
’ from package
‘qmao’.
A single vector, matrix, data frame, or time series.
# Create xts time series
xtsv <- xts(x=rnorm(1000), order.by=(Sys.time()-3600*(1:1000)))
# Split time series into daily list
list_xts <- split(xtsv, "days")
# rbind the list back into a time series and compare with the original
identical(xtsv, rutils::do_call_rbind(list_xts))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.