-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathas.POSIXct1970.Rd
executable file
·57 lines (55 loc) · 1.56 KB
/
as.POSIXct1970.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
\name{as.POSIXct1970}
\alias{as.POSIXct1970}
\title{
\code{as.POXIXct} for number of seconds since the start of 1970.
}
\description{
\code{as.POSIXct.numeric} requires origin to be specified. This assumes that
it is the start of 1970.
}
\usage{as.POSIXct1970(x, tz="GMT", ...)}
\arguments{
\item{x}{
a numeric vector of times in seconds since the start of 1970. (If
\code{x} is not numeric, call \code{as.POSIXct}.)
}
\item{tz}{
A timezone specification to be used for the conversion, if one is
required. System-specific (see time zones), but "" is the current
timezone, and "GMT" is UTC (Universal Time, Coordinated).
}
\item{\dots}{optional arguments to pass to as.POSIXct.}
}
\details{
o1970 <- strptime('1970-01-01', '%Y-%m-%d', tz='GMT'),
o1970. <- as.POSIXct(o1970),
as.POSIXct(x, origin=o1970.)
}
\value{
Returns a vector of class \code{POSIXct}.
}
\references{
Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009),
\emph{Functional data analysis with R and Matlab}, Springer, New
York.
Ramsay, James O., and Silverman, Bernard W. (2005), \emph{Functional
Data Analysis, 2nd ed.}, Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2002), \emph{Applied
Functional Data Analysis}, Springer, New York.
}
\author{
Spencer Graves
}
\seealso{
\code{\link{as.POSIXct}},
\code{\link{ISOdate}},
\code{\link{strptime}}
}
\examples{
sec <- c(0, 1, 60, 3600, 24*3600, 31*24*3600, 365*24*3600)
Sec <- as.POSIXct1970(sec)
\dontshow{stopifnot(}
all.equal(sec, as.numeric(Sec))
\dontshow{)}
}
\keyword{manip}