posixctCut {WebAnalytics} | R Documentation |
Replacement For cut.POSIXct
Description
Cut replacementthat Returns POSUIXct type to avoid the lack of round-trip support in POSIXt types between Cut, as character and as.POSIXXct
Usage
posixctCut(timeVector, interval)
Arguments
timeVector |
vector of POSIXt type |
interval |
a character string consisting of zero or one digits (a count), an optional space, a word identifying the units to be grouped:sec, secs, min, mins, hour, hours, day, days, week, weeks. For example: "1 hour", "3 weeks" or "17 seconds". |
Value
Returns a vector of POSIXct types, cut to the intervals specified.
Author(s)
Greg Hunt <greg@firmansyah.com>
Examples
d = as.POSIXct(c("2025-07-16 23:00:00", "2023-07-02 16:34:03", "2025-02-11 13:24:24"))
posixctCut(d, "17 mins")
posixctCut(d, "1 hour")
posixctCut(d, "1 week")
[Package WebAnalytics version 0.9.13 Index]