avgokmts returning incorrect maximum rain from ok mesonet data
<p>I'm using the <code>okmesonet</code> package to get data on rainfall. I've tried using <code>avgokmts</code> from this package to calculate the rainfall for each day, but I'm getting non-sensical values.</p>

<p>Get rain data for Norman, OK (cumulative rain in mm over a day at 5 min intervals)</p>

<pre><code>library(okmesonet)
rainDat &lt;- okmts(begintime="2016-06-21 00:00:00", endtime="2016-07-04 00:00:00",
          station="NRMN", variables="RAIN", localtime=TRUE)
</code></pre>

<p>Calculate the max rain per day</p>

<pre><code>avgokmts(rainDat, by="day", metric="max")
</code></pre>

<p>Which returns these values</p>

<pre><code>   STID STNM DAY MONTH YEAR  RAIN     Time       Date
1  NRMN  121  21    06 2016  0.00 23:55:00 2016-06-22
2  NRMN  121  22    06 2016  0.25 23:55:00 2016-06-23
3  NRMN  121  23    06 2016 59.70 23:55:00 2016-06-24
4  NRMN  121  24    06 2016  0.00 23:55:00 2016-06-25
5  NRMN  121  25    06 2016  0.00 23:55:00 2016-06-26
6  NRMN  121  26    06 2016  0.00 23:55:00 2016-06-27
7  NRMN  121  27    06 2016  0.00 23:55:00 2016-06-28
8  NRMN  121  28    06 2016  0.00 23:55:00 2016-06-29
9  NRMN  121  29    06 2016  0.00 23:55:00 2016-06-30
10 NRMN  121  30    06 2016 28.19 23:55:00 2016-07-01
11 NRMN  121  01    07 2016  0.00 23:55:00 2016-07-02
12 NRMN  121  02    07 2016  0.51 23:55:00 2016-07-03
13 NRMN  121  03    07 2016  0.00 23:55:00 2016-07-04
14 NRMN  121  04    07 2016  0.00 00:00:00 2016-07-04
</code></pre>

<p>But these rainfall values very clearly don't match up with the rainfall as graphed below (peak rainfall occurs on June 27th and July 3rd).</p>

<pre><code>plot(rainDat$TIME, rainDat$RAIN, xlab="Date", ylab="Cumulative Daily Rain (mm)")
</code></pre>

<p><a href="https://i.stack.imgur.com/voVz2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/voVz2.png" alt="cumulative rain fall plot"></a></p>

<p>Why isn't <code>avgokmts</code> working in this case? Is there an error in how I'm calling the function? Is there an alternative way to calculate daily rainfall using this dataset?</p>