Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hours

Return Hours, Minutes, or Seconds from a Times Object


Description

Given a chron or times object, extract the hours, minutes or seconds of the time it represents.

Usage

hours(x)
minutes(x)
seconds(x)

Arguments

x

an object inheriting from class "times", or coercible to such via as.chron.

Value

the corresponding time period as an ordered factor.

See Also

Examples

x <- chron(dates = c("02/27/92", "02/27/92", "01/14/92", "02/28/92"),
           times = c("23:03:20", "22:29:56", "01:03:30", "18:21:03"))
h <- hours(x)
y <- runif(4)
boxplot(y ~ h)

chron

Chronological Objects which can Handle Dates and Times

v2.3-56
GPL-2
Authors
David James [aut] (S original), Kurt Hornik [aut, trl, cre] (<https://orcid.org/0000-0003-4198-9911>), Gabor Grothendieck [ctb], R Core Team [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.