I have a data frame with something like the following structure:
Trial Index Condition1 Condition2 Measures
1 A Y ...
2 A Y ...
3 B Y ...
4 B Y ...
5 A Z ...
6 A Z ...
7 B Z ...
8 B Z ...
I would like to compute a number of summary measures on each combination of Condition1 and Condition2, and for the margins. I can use multiple calls to ddply to do this, but I was wondering if there is some simple way to get a single data structure out of it, something like:
Condition1 Condition2 Mean Median ....
A Y ... ... ....
A Z ... ... ....
A - ... ... ....
B Y ... ... ....
B Z ... ... ....
B - ... ... ....
- Y ... ... ....
- Z ... ... ....