Note that there are some explanatory texts on larger screens.

plurals
  1. POMerging aggregate data in R
    primarykey
    data
    text
    <p>Following up my <a href="https://stackoverflow.com/questions/5200437/aggregating-hourly-data-into-daily-aggregates">previous question</a> about aggregating hourly data into daily data, I want to continue with (a) monthly aggregate and (b) merging the monthly aggregate into the original dataframe.</p> <p>My original dataframe looks like this:</p> <pre><code>Lines &lt;- "Date,Outdoor,Indoor 01/01/2000 01:00,30,25 01/01/2000 02:00,31,26 01/01/2000 03:00,33,24 02/01/2000 01:00,29,25 02/01/2000 02:00,27,26 02/01/2000 03:00,39,24 12/01/2000 02:00,27,26 12/01/2000 03:00,39,24 12/31/2000 23:00,28,25" </code></pre> <p>The daily aggregates have been answered in my <a href="https://stackoverflow.com/questions/5200437/aggregating-hourly-data-into-daily-aggregates">previous question</a>, and then I can find my way to produce the monthly aggregates from there, to something like this:</p> <pre><code>Lines &lt;- "Date,Month,OutdoorAVE 01/01/2000,Jan,31.33 02/01/2000,Feb,31.67 12/01/2000,Dec,31.33" </code></pre> <p>Where the OutdoorAVE is the monthly average of the daily minimum and maximum outdoor temperature. What I want to have in the end is something like this:</p> <pre><code>Lines &lt;- "Date,Outdoor,Indoor,Month,OutdoorAVE 01/01/2000 01:00,30,25,Jan,31.33 01/01/2000 02:00,31,26,Jan,31.33 01/01/2000 03:00,33,24,Jan,31.33 02/01/2000 01:00,29,25,Feb,31.67 02/01/2000 02:00,27,26,Feb,31.67 02/01/2000 03:00,39,24,Feb,31.67 12/01/2000 02:00,27,26,Dec,31.33 12/01/2000 03:00,39,24,Dec,31.33 12/31/2000 23:00,28,25,Dec,31.33" </code></pre> <p>I do not know enough R on how to do that. Any help is greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload