r data.table helper functions