0

My line of code with the aggregate function found the average(mean) for each value in group 1 and group 2. I want to rearrange this table so that the group 2 values (1 and 2) are the column headings and group 1 values (0-4) are the row headings and then the x values is the data in the middle of the table.

enter image description here

I have tried using the tapply function but I did not get anywhere with that.

Phil
  • 7,287
  • 3
  • 36
  • 66
  • Welcome to SO. Please make your post [reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by providing your data using `dput()`. Please don't post images of code/data. – jrcalabrese Nov 21 '22 at 02:17

0 Answers0