I have a data.table with one column of POSIXcts.
dt <- data.table(DateTime=seq(from=as.POSIXct("2017-02-01 00:00", tz="Europe/Berlin"), by=3600, length.out = 10), Value=1:10)
I thought I can use max(), but that does not work.
maxDateTime <- max(dt[, "DateTime"])
And also last() from 'data.table' package is not doing it:
maxDateTime <- last(dt[, "DateTime"])
Only tail() is going in the right direction
maxDateTime <- tail(dt[, "DateTime"],1)
but returns a data.table, where I only would like to have a single value.
It is a rather simple problem, but I am stuck with it for a while now, so I hope for the right hint here. Thanks!