0 votes
1 view
in R Programming by (5.3k points)

I'm plotting and performing calculations on uniformly distributed time series. The timestamps are currently stored as integers representing the number of seconds since the UNIX epoch (e.g. 1352068320), but Date objects seem more appropriate for plotting. How can I do the conversion?

I've read ?Date, ?as.Date and ??epoch, but seem to have missed that information.

1 Answer

0 votes
by (25.3k points)

To convert UNIX epoch to a Date object, you can use the anytime package as follows:

library("anytime")

anytime(1352068320)

[1] "2012-11-05 04:02:00 IST"

anydate(1352068320)

[1] "2012-11-05"

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...