View source: R/activity_code.r
gettime | R Documentation |
Accepts data of class POSIXct, POSIXlt or character and returns the time of day element as numeric (any date element is ignored).
gettime( x, scale = c("radian", "hour", "proportion"), ..., tryFormats = c("%Y-%m-%d %H:%M:%OS", "%Y/%m/%d %H:%M:%OS", "%Y:%m:%d %H:%M:%OS", "%Y-%m-%d %H:%M", "%Y/%m/%d %H:%M", "%Y:%m:%d %H:%M", "%Y-%m-%d", "%Y/%m/%d", "%Y:%m:%d") )
x |
A vector of POSIXct, POSIXlt or character format time data to convert. |
scale |
The scale on which to return times (see Value for options). |
... |
arguments passed to as.POSIXlt |
tryFormats |
formats to try when converting date from character, passed to as.POSIXlt |
A vector of numeric times of day in units defined by the scale
argument:
radian, on the range [0, 2*pi];
hours, on the range [0, 24];
proportion, on the range [0, 1].
strptime
data(BCItime) rtime <- gettime(BCItime$date) htime <- gettime(BCItime$date, "hour") ptime <- gettime(BCItime$date, "proportion") summary(rtime) summary(htime) summary(ptime)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.