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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:52:01+00:00 2026-05-13T13:52:01+00:00

Given I have a zoo dataset, I’d like to perform a sliding operation against

  • 0

Given I have a zoo dataset, I’d like to perform a sliding operation against it with the result being another zoo dataset.

> x
                      Y
(09/24/09 08:00:13)   3.1
(09/24/09 08:05:13)   4.2
(09/24/09 08:10:13)   4.5
(09/24/09 08:15:13)   9.4
(09/24/09 08:20:13)   9.8
(09/24/09 08:25:13)   7.7
(09/24/09 08:30:13)  13.3
(09/24/09 08:35:13)   6.5
(09/24/09 08:40:13)  14.7
(09/24/09 08:45:13)  23.5
(09/24/09 08:50:13)  20.9
(09/24/09 08:55:13)   8.5

My goal is to produce a "smooth" average by iterating through each time interval and obtaining the mean for the set of Y points that are +/- 15 minutes of the current point.

I have a bucketing method of averaging working, but it reduces the resolution of the data. I haven’t worked out how to make relative subsets out of zoo with artibrary math, window should help but accessing the index is being difficult.

Thanks.

  • 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-05-13T13:52:01+00:00Added an answer on May 13, 2026 at 1:52 pm

    Use rollmean. Here’s an example:

    x.Date <- as.Date(paste(2004, rep(1:4, 4:1), sample(1:28, 10), sep = "-"))
    x <- zoo(rnorm(12), x.Date)
    rollmean(x, 3)
    

    In you case, you will want to lag your data after taking the mean since you the mean around a point in time.

    Lastly, you should know about the rollapply function in zoo which can do a rolling operation on any function (including one that you define).

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

Sidebar

Related Questions

Given i have a class like so in my Data Layer public class GenericRepository<TEntity>
Given I have data like the following, how can I select and group by
Given you have to implement a news feed like the one seen in social
I have given date strings like these: Mon Jun 28 10:51:07 2010 Fri Jun
I have a zoo with daily data that looks like this: > head(almorol) 1973-10-02
Given I have a background drawable to create bulletpoints for TextViews like this: Then
Given I have code like the following: void foo() { String str = hello;
Given I have a Model object like ... public class MyModel { public int
I have given word like abca . I want to know how many letters
Given I have an Artifact model and a User model: I would like to

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.