date2day | R Documentation |
A function to convert date-time data to decimal days with respect to a date-time origin.
date2day(dates, start=NULL, tz="", ...)
dates |
A date-time or date object. Typically, it is a character vector containing date-time information. |
start |
A date-time or date object. Determines the origin of the conversion. |
tz |
Optional. Timezone specification to be used for the conversion. |
... |
Arguments to be passed to |
The arguments dates
and start
must be of
appropriate format to be passed to as.POSIXlt
function.
A numeric vector of the same length as dates
.
Abdollah Jalilian jalilian@razi.ac.ir
as.POSIXlt
and difftime
for appropriate format of the data
to be converted.
# date-time data of Iran's earthquakes between 1973/01/01 and 2016/01/01
dt <- paste(iran.quakes$date, iran.quakes$time)
# origin of the conversion
start <- "1973/01/01 00:00:00"
# time in days since 1973-01-01 (UTC)
date2day(dt, start, tz="GMT")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.