firstof: Create a POSIXct Object

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

Description

Enable fast creation of time stamps corresponding to the first or last observation in a specified time period.

Usage

1
firstof(year = 1970, month = 1, day = 1, hour = 0, min = 0, sec = 0, tz = "")

Arguments

year,month,day

numerical values to specify a day

hour,min,sec

numerical vaues to specify time within a day

tz

timezone used for conversion

Details

A wrapper to the R function ISOdatetime with defaults corresponding to the first or last possible time in a given period.

Value

An object of class POSIXct.

Author(s)

Jeffrey A. Ryan

See Also

ISOdatetime

Examples

1
2
3
4
5
firstof(2000)
firstof(2005,01,01)

lastof(2007)
lastof(2007,10)

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

[1] "2000-01-01 UTC"
[1] "2005-01-01 UTC"
[1] "2007-12-31 23:59:59 UTC"
[1] "2007-10-31 23:59:59 UTC"

xts documentation built on July 19, 2018, 9:03 a.m.