Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8412681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:44:06+00:00 2026-06-10T00:44:06+00:00

I have a list of xts objects that are mutually exclusive days. I would

  • 0

I have a list of xts objects that are mutually exclusive days. I would like to merge the list into one large xts object. My attempt at doing this was to”

merged_reg_1_min_prices <- do.call(cbind, reg_1_min_prices)

However this seems to run out of memory. reg_1_min_prices is 6,000 days of 1 minute returns on mutually exclusive days so it’s not very large. Does anyone know how to get around this?

To be clear: reg_1_min_prices contains mutually exclusive days with 1 minute prices on each day and each entry in the list is an xts object.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:44:07+00:00Added an answer on June 10, 2026 at 12:44 am

    I use the strategy provided by Dominik in his answer to this question

    I have turned it into a function in my qmao package. This code is also at the core of getSymbols.FI in the FinancialInstrument package.

    do.call.rbind <- function(lst) {
      while(length(lst) > 1) {
        idxlst <- seq(from=1, to=length(lst), by=2)
        lst <- lapply(idxlst, function(i) {
          if(i==length(lst)) { return(lst[[i]]) }
          return(rbind(lst[[i]], lst[[i+1]]))
        })
      }
      lst[[1]]
    }
    

    If you want to rbind data.frames, @JoshuaUlrich has provided an elegant solution here


    As far as I can tell (without looking very closely) memory is not an issue with any of the three solutions offered (@JoshuaUlrich’s, @Alex’s, and qmao::do.call.rbind). So, it comes down to speed…

    library(xts)
    l <- lapply(Sys.Date()-6000:1, function(x) {
        N=60*8;xts(rnorm(N),as.POSIXct(x)-seq(N*60,1,-60))})
    GS <- do.call.rbind
    JU <- function(x) Reduce(rbind, x)
    Alex <- function(x) do.call(rbind, lapply(x, as.data.frame)) #returns data.frame, not xts
    
    identical(GS(l), JU(l)) #TRUE
    
    library(rbenchmark)
    benchmark(GS(l), JU(l), Alex(l), replications=1)
         test replications elapsed relative user.self sys.self user.child sys.child
    3 Alex(l)            1  89.575 109.9080    56.584   33.044          0         0
    1   GS(l)            1   0.815   1.0000     0.599    0.216          0         0
    2   JU(l)            1 209.783 257.4025   143.353   66.555          0         0
    

    do.call.rbind clearly wins on speed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of xts objects. I'd like to get a data.frame with
I have a df/zoo/xts/whatever that is split by day of week. I'd like to
I have an xts numeric matrix that includes multiple days of minute interval series.
I have a xts object (stock price time series) that is comprised of intraday
I have List of User object, I just want to get User objects from
I have an xts object that has intraday data: head(stocks[,1]) SMH.close 2009-01-02 09:31:00 17.66
i have list like that: <ul> <li><a...>...</a></li> <li>...</li> </ul> where both type of listelements
At the moment I have List of Job objects that are queued to be
I have list of objects that contain information about which classes static EventHandler should
I have list of input area in the form with id like contact1_title, contact2_title,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.