I started using data.table package in R to boost performance of my code. I am using the following code:
sp500 <- read.csv(\'../rawdata/GMTSP.csv\')
days &
This is an old question, but I think this tiny trick it might be useful. If you have multiple rows with the same date, you can do
data[, date := as.Date(date[1]), by = date]
It's much faster since it only processes each date once (in my dataset of 40 million rows it goes from 25 seconds to 0.5 seconds).