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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:09:16+00:00 2026-06-16T00:09:16+00:00

I have a time series and I wanted to perform average automatically every 1

  • 0

I have a time series and I wanted to perform average automatically every 1 hour.
My data include temperature and date_time (timestamps)
I do not want moving average, I would like to have average for 1, 2, 3, 4, … o’clock since the frequency of data is usually 2minutes for a single day.

 temperature    date_time
1     -1.52 2007-09-29 00:00:08
2     -1.48 2007-09-29 00:02:08
3     -1.46 2007-09-29 00:04:08
4     -1.56 2007-09-29 00:06:08
5     -1.64 2007-09-29 00:08:08
6     -1.75 2007-09-29 00:10:08
7     -1.74 2007-09-29 00:12:08
8     -2.02 2007-09-29 00:14:08
9     -2.02 2007-09-29 00:16:08
10    -1.90 2007-09-29 00:18:08
11    -1.66 2007-09-29 00:20:08
12    -1.80 2007-09-29 00:22:08
13    -1.68 2007-09-29 00:24:08
14    -1.81 2007-09-29 00:26:08
15    -1.77 2007-09-29 00:28:08
16    -1.83 2007-09-29 00:30:08
17    -1.84 2007-09-29 00:32:08
18    -1.93 2007-09-29 00:34:08
19    -1.62 2007-09-29 00:36:08
20    -1.87 2007-09-29 00:38:08
21    -1.54 2007-09-29 00:40:08
22    -1.93 2007-09-29 00:42:08
23    -1.88 2007-09-29 00:44:08
24    -1.82 2007-09-29 00:46:08
25    -1.78 2007-09-29 00:48:08
26    -1.67 2007-09-29 00:50:08
27    -1.67 2007-09-29 00:52:08
28    -1.56 2007-09-29 00:54:08
29    -1.84 2007-09-29 00:56:08
30    -1.74 2007-09-29 00:58:08
31    -1.79 2007-09-29 01:00:08
32    -1.82 2007-09-29 01:02:08
33    -1.78 2007-09-29 01:04:08
34    -1.88 2007-09-29 01:06:08
35    -1.84 2007-09-29 01:08:08
36    -1.78 2007-09-29 01:10:08
37    -1.94 2007-09-29 01:12:08
38    -1.80 2007-09-29 01:14:08
39    -1.74 2007-09-29 01:16:08
40    -1.76 2007-09-29 01:18:08
41    -1.80 2007-09-29 01:20:08
42    -1.60 2007-09-29 01:22:08
43    -1.59 2007-09-29 01:24:08
44    -1.52 2007-09-29 01:26:08
45    -1.41 2007-09-29 01:28:08
46    -1.42 2007-09-29 01:30:08
47    -1.44 2007-09-29 01:32:08
48    -1.38 2007-09-29 01:34:08
49    -1.34 2007-09-29 01:36:08
50    -1.40 2007-09-29 01:38:08
51    -1.40 2007-09-29 01:40:08
52    -1.48 2007-09-29 01:42:08
53    -1.36 2007-09-29 01:44:08
54    -1.42 2007-09-29 01:46:08
55    -1.46 2007-09-29 01:48:08
56    -1.46 2007-09-29 01:50:08
57    -1.47 2007-09-29 01:52:08
58    -1.50 2007-09-29 01:54:08
59    -1.51 2007-09-29 01:56:08
60    -1.49 2007-09-29 01:58:08
61    -1.54 2007-09-29 02:00:08
62    -1.50 2007-09-29 02:02:08
63    -1.55 2007-09-29 02:04:08
64    -1.52 2007-09-29 02:06:08
65    -1.66 2007-09-29 02:08:08
66    -1.88 2007-09-29 02:10:08
67    -1.72 2007-09-29 02:12:08
68    -1.68 2007-09-29 02:14:08
69    -1.68 2007-09-29 02:16:08
70    -1.60 2007-09-29 02:18:08
71    -1.71 2007-09-29 02:20:08
72    -1.71 2007-09-29 02:22:08
73    -1.80 2007-09-29 02:24:08
74    -1.76 2007-09-29 02:26:08
75    -1.84 2007-09-29 02:28:08
76    -1.96 2007-09-29 02:30:08
77    -2.06 2007-09-29 02:32:08
78    -2.16 2007-09-29 02:34:08
79    -2.04 2007-09-29 02:36:08
80    -1.93 2007-09-29 02:38:08
81    -1.98 2007-09-29 02:40:08
82    -1.86 2007-09-29 02:42:08
83    -2.08 2007-09-29 02:44:08
84    -1.78 2007-09-29 02:46:08
85    -1.50 2007-09-29 02:48:08
86    -1.60 2007-09-29 02:50:08
87    -1.53 2007-09-29 02:52:08
88    -1.76 2007-09-29 02:54:08
89    -1.64 2007-09-29 02:56:08
90    -1.52 2007-09-29 02:58:08
91    -1.82 2007-09-29 03:00:08
  • 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-16T00:09:16+00:00Added an answer on June 16, 2026 at 12:09 am

    Assuming your dataset is called temp and that your “date_time” variable is a proper date format (done using, say, as.POSIXlt(temp$date_time), then you can simply use aggregate and cut to get hourly summaries:

    aggregate(list(temperature = temp$temperature), 
              list(hourofday = cut(temp$date_time, "1 hour")), 
              mean)
    #             hourofday temperature
    # 1 2007-09-29 00:00:00   -1.744333
    # 2 2007-09-29 01:00:00   -1.586000
    # 3 2007-09-29 02:00:00   -1.751667
    # 4 2007-09-29 03:00:00   -1.820000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two time series of data, one which is water temperature and the
I have a data.frame of a time series of data, I would like to
I have an irregular(?) time series data points in a day as following Jun
I have some time-series data that I'm fitting a loess curve in ggplot2, as
I have a time series of continuous data measured at 10 minute intervals for
I have two time series data frames: The first one: head(df1) : MSCI ACWI
I wanted to plot time series data in R by using ggplot but I
I have a time series(a csv file) data that looks like below. Each observation
i have a time series data like this: x <- structure(list(date = structure(c(1264572000, 1266202800,
I have a time series in the following format: time data value 733408.33 x1

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.