Use data.table for speed.