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 8378565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:57:29+00:00 2026-06-09T15:57:29+00:00

i have an xts object which is about 2 mil rows. i am trying

  • 0

i have an xts object which is about 2 mil rows. i am trying to use rollapply with width=10000. rollapply seems to run out of memory and i am having trouble figuring out why? (i tried to look at the source by typing > rollapply but only this shows up:

function (data, ...) 
 UseMethod("rollapply")
 <environment: namespace:zoo>

does rollapply create 2 million – 10,000 copies of each chunk and then pass them in one by one? this would certainly cause it to run out of memory but i don’t think the creators of zoo would have done that? if that is the case, then does anyone know a more clever way to do my rolling apply.. my current plan is to simply do this:

m <- vector()
for (i in 10001:nrow(my_xts)) {
   m <- c(m, my_fun(my_xts[i-10000:i]))

}

sure there is a better way?

  • 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-09T15:57:30+00:00Added an answer on June 9, 2026 at 3:57 pm

    It looks like the memory consumption is occurring during the mapply call in zoo:::rollapply.zoo. There is an xts rollapply method but it is not exported, so it will not be called via method dispatch. That said, you can call it explicitly:

    my_xts <- .xts(1:1e5*1,1:1e5)
    m <- xts:::rollapply.xts(my_xts, width=10000, FUN=sum)
    

    Use methods(foo) to see what methods are available whenever you encounter:

    function(...)
      UseMethod("foo")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an xts object, the first column of which is date-time, followed by
I have one main XTS object Data with ~1M rows spanning 22 days. I
I have an xts object, for example ts=xts(seq(10),seq(Sys.Date(),Sys.Date()+10,length.out=10)) and need to add a new
I have an xts object, x. I want to run a for loop until
I have a continuous univariate xts object of length 1000, which I have converted
I am trying to divide an xts object which holds a number of time
I have three vectors in an xts R object. Call them V1, V2, V3.
have written this little class, which generates a UUID every time an object of
I have an XTS timeseries in R of the following format and am trying
I have an xts numeric matrix on which I need to apply many transformations.

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.