date2day: Convert date-time data to numeric data in decimal days

Description Usage Arguments Details Value Author(s) See Also Examples

Description

A function to convert date-time data to decimal days with respect to a date-time origin.

Usage

1
  date2day(dates, start=NULL, tz="", ...)

Arguments

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 as.POSIXlt.

Details

The arguments dates and start must be of appropriate format to be passed to as.POSIXlt function.

Value

A numeric vector of the same length as dates.

Author(s)

Abdollah Jalilian jalilian@razi.ac.ir

See Also

as.POSIXlt and difftime for appropriate format of the data to be converted.

Examples

1
2
3
4
5
6
  # 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")


Search within the ETAS package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.