TS: bless a numeric vector with "timestamp" class

Description Usage Arguments Value Author(s)

Description

adds c("POSIXt", "POSIXct") to the beginning of the class attribute of a numeric vector so that operations such as arithmetic and printing treat it as a timestamp.

Usage

1
TS(x)

Arguments

x

numeric vector; should be seconds since the unix epoch (1 Jan 1970 GMT).

Value

structure(x, class=c("POSIXt", "POSIXct", class(x)))

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm


jbrzusto/motus-R-package documentation built on May 18, 2019, 7:03 p.m.