Not sure what I am doing wrong here, and would appreciate any assistance.
Trying to make a new variable named “control” and coding it 1 when the row variable is equal to these numbers, and 0 when it is not.
data$control= ifelse (data$row==c(146, 297, 313, 171, 262, 233, 292, 304, 264, 228, 279,
281, 290, 277, 152, 161, 250, 263, 245, 83, 67, 101, 98, 251, 148, 155, 322, 265,
159, 271, 278, 289, 274, 282, 158, 196, 154, 260, 163, 307, 272, 299, 300, 273, 167,
286, 149, 316, 147, 162, 178), 1, 0)
It makes a new variable named “control” but only codes it as 1 for row=149 and row=264. I really cannot figure this out.
Thanks for the help,
Chris
You mean to use
%in%rather than==: