I would like to use the t.test function to compare groups of values stored in a dataframe. Let say my dataframe has 2 columns : "group" and "result" and 40 lines. The "result" column contains the values I want to compare, and the "group" column indicates the groups in which the values are divided : for example 4 groups (a,b,c,d) of 10 values each.
How can I indicate that I only want to test the values belonging to group a versus the values belonging to group b ?
Alternatively, is there a simple way to extract the values belonging to the group a into a vector (let's call it "vecta") in order to compare the vectors at will ?
Thanks in advance ! Seb