I have some within Subject measures and I want to assign a new Group variable to Subject Numbers (e.g: Subjects from 1 to 15 should be labeled as a Control Group and 15 to 30 as an Experimental Group).
I have 36 between subject trial measures for each Subject. I would like to create a new column where each subject trial will be labeled as Exp. or Contr. trial.
Subject Condition
1 10 Cont
2 10 Cont
3 10 Cont
4 10 Cont
5 10 Cont
6 10 Cont
7 10 Cont
8 10 Cont
9 10 Cont
10 10 Exp
11 10 Cont
12 10 Cont
13 10 Cont
14 10 Cont
15 10 Cont
16 10 Cont
17 10 Cont
18 10 Cont
19 10 Cont
20 10 Cont
21 10 Cont
22 10 Cont
23 10 Exp
24 10 Cont
25 10 Cont
26 10 Cont
27 10 Cont
28 10 Cont
29 10 Cont
30 10 Cont
31 10 Cont
32 10 Cont
33 10 Cont
34 10 Cont
35 10 Cont
36 10 Exp
37 11 Exp
38 11 Cont
39 11 Cont
40 11 Cont
41 11 Cont
42 11 Cont
43 11 Cont
44 11 Cont
45 11 Cont
46 11 Cont
47 11 Cont
48 11 Cont
49 11 Cont
50 11 Exp
51 11 Cont
52 11 Cont
53 11 Cont
54 11 Cont
55 11 Cont
56 11 Cont
57 11 Cont
58 11 Cont
59 11 Cont
60 11 Cont
61 11 Cont
62 11 Cont
63 11 Exp
64 11 Cont
65 11 Cont
66 11 Cont
67 11 Cont
68 11 Cont
69 11 Cont
70 11 Cont
71 11 Cont
72 11 Cont
73 12 Cont
74 12 Cont
75 12 Cont
76 12 Cont
77 12 Exp
78 12 Cont
79 12 Cont
80 12 Cont
81 12 Cont
82 12 Cont
83 12 Cont
84 12 Cont
85 12 Cont
86 12 Cont
87 12 Cont
88 12 Cont
89 12 Cont
90 12 Exp
91 12 Cont
92 12 Cont
93 12 Cont
94 12 Cont
95 12 Cont
96 12 Cont
97 12 Cont
98 12 Cont
99 12 Cont
100 12 Cont
101 12 Cont
102 12 Cont
103 12 Exp
104 12 Cont
105 12 Cont
106 12 Cont
107 12 Cont
108 12 Cont
109 13 Cont
110 13 Cont
111 13 Cont
112 13 Cont
...
I used (as suggsted by Craig):
mutate(Condition = ifelse(Subject == 1:15, "Exp", "Cont"))
But I get mixed results..