I am experimenting with R to analyse some measurement data. I have a .csv file containing more than 2 million lines of measurement. Here is an example:
You can try the code below.
library(data.table) data <- fread("C:/RData/house2_electricity_main.csv") data[, V1 := as.POSIXct(V1)]
There was a question recently about usage of
fasttime::fastPOSIXct instead of
as.POSIXct which can additionally speed up.
As for the title question, having POSIXct you can round it quite freely, e.g. functions
data[, .SD, by = .(year(V1),month(V1),mday(V1))]