
Last chance! 50% off unlimited learning
Sale ends in
Coercion functions for creating difftime
objects from other
existing objects.
as.difftime(tim, ...)# S3 method for default
as.difftime(tim, format = "%X", units = "auto", ...)
A difftime
object with an attribute indicating the units.
A vector specifying a time interval.
Other arguments passed on to methods.
A single character specifying the format of tim
when it is
a character. The default is a locale-specific time format.
A single character specifying units in which the results are
desired. Required if tim
is a numeric.
generics:::methods_rd("as.difftime")
This function overrides the non-generic as.difftime()
function
provided in base so that packages can provide methods for different data
types. The default method call the base version.
as.difftime(1:5, units = "secs")
as.difftime(c("01:55:22", "01:55:25"))
as.difftime("01", format = "%H")
as.difftime("01", format = "%H", units = "secs")
Run the code above in your browser using DataLab