How to split a variable?

Hi, total R newbie here.

I am looking to compare three different conditions of a task (in three separate variables) within two genders. How do I split my variables by gender to run the analyses separately? Is there a way to do this in R (my best guess is some equivalent to "when Gender=Male, then run this thing"

Is there a shortcut like this? I can't find anything online. My other option is to split my dataset in Excel before reading it into R and running two completely separate analyses?

Any advice is greatly appreciated. Thank you!

Depending on what kind of analysis you could filter the data or group it, but to give you any specific advice we would need more information.

Can you please provide a proper REPRoducible EXample (reprex) illustrating your issue?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.