11.1 “Common operations”:
You can use
t()
Do aggregate with
apply()
(see data.frame)
The second argument is specifying the dimensions mostly: 1 for row and 2 for columns but it can be “expanded”.
## Age
## Class Child Adult
## 1st 1.50 79.75
## 2nd 6.00 65.25
## 3rd 19.75 156.75
## Crew 0.00 221.25