'extract mean value based on 3 column conditions

I have 4 columns:

  • subject (ID# - there are 50 subjects)
  • hemisphere (right or left)
  • condition (gain or loss)
  • volume (continuous)

I want to extract the mean value of volume for each subject per condition/hemisphere. Each subject # appears multiple times because this task was repeated over 70 trials. I then want to create a dataframe with these values.

Any help would be greatly appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source