floorPOSIXct: floorPOSIXct

Description Usage Arguments Examples

Description

floorPOSIXct

Usage

1
floorPOSIXct(x, units = "days", offset = "0 days", ...)

Arguments

x

The POSIXct vector

units

How to cut the values. The units are partially matched in c('secs', 'mins', 'hours', 'days'). A number can precede the unit.

offset

To use in the case where a cut occurs at a inconvenient date (see examples).

Examples

1
2
3
4
5
6
7
8
data(exses)
x <- exses$stat$time - 304*(24*3600)
plot(x, x, type = 'l')
lines(x, floorPOSIXct(x, '2days'), col = 'blue', type = 's')
# To force the cut to occur on the 1st January
lines(x, floorPOSIXct(x, '2days', '1d'), col = 'lightblue', type = 's')
lines(x, floorPOSIXct(x, 'days'), col = 'red', type = 's')
lines(x, floorPOSIXct(x, '0.5d'), col = 'green', type = 's')

SESman/rbl documentation built on May 9, 2019, 11:10 a.m.