numberAsPOSIXct: Convert a Numeric Time to a POSIXct Time

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

View source: R/oce.R

Description

There are many varieties, according to the value of type as defined in ‘Details’.

Usage

1
2
numberAsPOSIXct(t, type = c("unix", "matlab", "gps", "argo", "ncep1", "ncep2",
  "sas", "spss", "yearday"), tz = "UTC")

Arguments

t

an integer corresponding to a time, in a way that depends on type.

type

the type of time (see “Details”).

tz

a string indicating the time zone, used only for unix and matlab times, since GPS times are always referenced to the UTC timezone.

Details

Value

A POSIXct time vector.

Author(s)

Dan Kelley

References

[1] Matlab times: http://www.mathworks.com/help/matlab/ref/datenum.html

[2] NCEP times: http://www.esrl.noaa.gov/psd/data/gridded/faq.html#3

[3] problem with NCEP times: https://github.com/dankelley/oce/issues/738

See Also

numberAsHMS

Other things related to time: ctimeToSeconds, julianCenturyAnomaly, julianDay, numberAsHMS, secondsToCtime, unabbreviateYear

Examples

1
2
3
4
numberAsPOSIXct(0)                     # unix time 0
numberAsPOSIXct(1, type="matlab")      # matlab time 1
numberAsPOSIXct(cbind(566, 345615), type="gps") # Canada Day
numberAsPOSIXct(cbind(2013, 0), type="yearday") # start of 2013

oce documentation built on May 29, 2017, 12:19 p.m.

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