Da: Eric Berger [ericjber...@gmail.com]
Inviato: martedì 22 settembre 2020 11.00
A: Jeff Newmiller
Cc: Stefano Sofia; r-help mailing list
Oggetto: Re: [R] aggregate semi-hourly data not 00-24 but 9-9
Thanks Jeff.
Stefano, per Jeff's comment, yo
Thanks Jeff.
Stefano, per Jeff's comment, you can replace the line
df1$data_POSIXminus9 <- df1$data_POSIX - lubridate::hours(9)
by
df1$data_POSIXminus9 <- df1$data_POSIX - as.difftime(9,units="hours")
On Mon, Sep 21, 2020 at 8:06 PM Jeff Newmiller wrote:
>
> The base R as.difftime function is
The base R as.difftime function is perfectly usable to create this offset
without pulling in lubridate.
On September 21, 2020 8:06:51 AM PDT, Eric Berger wrote:
>Hi Stefano,
>If you mean from 9am on one day to 9am on the following day, you can
>do a trick. Simply subtract 9hrs from each timestam
Hi Stefano,
If you mean from 9am on one day to 9am on the following day, you can
do a trick. Simply subtract 9hrs from each timestamp and then you want
midnight to midnight for these adjusted times, which you can get using
the method you followed.
I googled and found that lubridate::hours() can be
Dear R-list members,
I have semi-hourly snowfall data.
I should sum the semi-hourly increments (only the positive ones, but this is
not described in my example) day by day, not from 00 to 24 but from 9 to 9.
I am able to use the diff function, create a list of days and use the function
aggregate
5 matches
Mail list logo