double(length = 0L) is.double(x) as.double(x, ...) ## S3 method for class 'difftime': as.double(x, units = "auto", ...) ## S3 method for class 'POSIXlt': as.double(x, ...)
length | an integer giving the length of the returned object. |
x | any object. |
units | a character string must be one of "auto", "secs", "mins", "hours", "days", and "weeks". By default, is "auto", meaning to use a proper unit. |
... | additional arguments. |
double | returns a simple object of storage mode double, and the length specified. |
is.double | returns TRUE if x is an object of storage mode double. Otherwise, it returns FALSE. |
as.double | returns x if x is a simple object of storage mode double. Otherwise, it returns a vector of the same length as x and with data resulting from coercing the elements of x to storage mode double. if x can not be coerced to mode double, NAs will be introduced. |
as.double.POSIXlt | returns a double object representing the number of seconds since the Unix epoch, i.e., 1970-01-01 00:00:00 GMT. |
as.double.difftime | returns a double object representing the number of time units. |
double(3) # [1] 0 0 0 storage.mode(1:3) # [1] "integer" is.double(1:3) #[1] FALSE storage.mode(1) #[1] "double" is.double(1) #[1] TRUE# POSIXlt plt <- as.POSIXlt(c("1970-01-01 00:00:00", "2038-01-19 03:14:07")) as.double(plt)
# difftime dt <- as.difftime(c("01:00:00", "00:01:00", "00:00:01")) as.double(dt)