This example uses the copy data frame we made and uses the organisation code by the type of attendances. I want to then summarise the mean admissions by type and organisation code.
Pivots can be implemented in data.table in the following way:
I’ve never been the biggest fan of the syntax for
data.table but the performance is unquestionably there and that makes it worth learning. H/T R-bloggers.