TS: bless a numeric vector with "timestamp" class

Description Usage Arguments Value Author(s)

View source: R/TS.R

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/motusServer documentation built on May 19, 2019, 8:19 a.m.