hudsonb
02/01/2019, 1:56 PMBinModel
which allow this:
val avgWbccByAgeRange = patients.binByInt(valueSelector = { it.age }, binSize = 10, rangeStart = 20)
.averageByInt { it.whiteBloodCellCount }
For comparison, the article uses:
val avgWbccByAgeRange = patients.binByInt(
valueSelector = { it.age },
binSize = 10,
rangeStart = 20,
groupOp = { it.map { it.whiteBloodCellCount }.average() }
)
I'll put together a PR if you're interested.