I am trying to convert an ff vector with POSIXct entries to an ff numeric vector, containing the respective number of seconds since the origin 01-01-1970.
x = as.ff(as.POSIXct(c("2014-06-30 00:01:27 BST", "2014-06-30 00:02:17 BST")))
The 'natural' as.numeric(x)
does not work, yielding: numeric(0)
.
as.ff(as.numeric(x[]))
works, yielding
ff (open) double length=2 (2)
[1] [2]
1398898887 1398898937
which is the desirable outcome. Albeit, it involves the ram object x[]
. Is there a way to achieve the above result employing ff objects only (i.e. not intermediating the ram equivalent of the ff vector)?