time | R Documentation |
These are convenience functions to extract a time field from an object, such as a character string or a data frame.
time(x, ...)
## Default S3 method:
time(x, date, time, year, month, day, hour = 0, minute = 0, second = 0, ...)
## S3 method for class 'logical'
time(x, ...)
## S3 method for class 'numeric'
time(x, ...)
## S3 method for class 'character'
time(x, ...)
## S3 method for class 'data.frame'
time(x, ...)
x |
Object. |
... |
Further arguments passed onto |
date |
Date object or formatted character string representing a date. |
time |
Time object or formatted character string representing a time. |
year |
Date year. |
month |
Date month. |
day |
Date day. |
hour |
Time hour. |
minute |
Time minute. |
second |
Time second. |
Generally a POSIXct
or POSIXt
object.
time(default)
: Default time method.
time(logical)
: Convert time from logical value.
time(numeric)
: Convert time from numeric value.
time(character)
: Convert time from character string.
time(data.frame)
: Extract time from data frame.
time() # Current time (base method).
# Equivalent nine o'clock specification:
time(9)
time("9")
time("9h")
time("9h00")
time("9:00")
time("9:00:00")
# All equivalent time strings:
time("194501")
time("19:45:01")
time("19h45m01")
time("19h45m01")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.