I want to do an analysis for each group in a row but it is a tedious way to filter each group.
My current data is like this after I have aggregate date data and group data to find the mean.
| group.1 | group.2 | x |
|---|---|---|
| 1.2.21 | A | 20 |
| 2.2.21 | A | 30 |
| 1.2.21 | B | 10 |
| 2.2.21 | B | 40 |
This is the ouput that i trying to do.
| DATE | A | B |
|---|---|---|
| 1.2.21 | 20 | 10 |
| 2.2.21 | 30 | 40 |
I have try using tapply but it is not the output that i want.