I have a numeric key in a data.table that sometimes has infinite values. I discovered today that Inf does not collapse when used in a by. Is this expected? It surprised me:<div><br></div><div>DT <- data.table(x=rep(c(1,Inf), each=10), y=1:20)</div>
<div><br></div><div>DT[, sum(y), by=x] # The x==1 cases collapse, but the Inf cases don't</div>