You #R  wizards here, please consider this situation. We have two eyes; so frequently my data is in this form (simplified, of course):

subject01 rightEye condition01 value

subject01 rightEye condition02 value

subject01 rightEye condition03 value

subject01 leftEye condition01 value

subject01 leftEye condition02 value

subject01 leftEye condition03 value

subject02 …

To compare something between the eyes the needs to be arranged like so:

subject01 condition01 valueRightEye valueLeftEye

subject01 condition02 valueRightEye valueLeftEye

subject01 condition03 valueRightEye valueLeftEye

subject 02…

There must be a clever way with melt and cast from "reshape2" rather than my current clumsy loops for this. Suggestions warmly welcomed!

Thanks in advance, best, Michael.