dataset being used is in this google sheets link https://docs.google.com/spreadsheets/d/1eV33Sgx_UVtk2vDtNBc4Yqs_kQoeffY0oj5gSCq9rCs/edit#gid=1959019385&vpid=A1
AMC.dataset$ExamMC.A<-surveySP15$Exams_A
AMC.dataset$ExamMC.A<-factor(NA, levels=c("TRUE", "FALSE"))
AMC.dataset$ExamMC.A[AMC.dataset$Exams_A=="1 time"|AMC.dataset$Exams_A=="2-4 times"|AMC.dataset$Exams_A==">4 times"]<-"TRUE"
AMC.dataset$ExamMC.A[AMC.dataset$Exams_A=="0 times"]<-"FALSE"
AMC.dataset$ExamMC.A=as.logical(AMC.dataset$ExamMC.A)
I use these 5 lines of code to re-code all 9 of the Exams_A through Exams_I variables into logical binary outcomes of "True" for those who have answered 1 or more times for any of these 9 variables. I would like to combine all of these variables into a new column in the dataset in which for each observation row, if there is even one case that is "true" for any of the 9 exams_A through I in that entire row, the new variable outcome will read as "true" meaning they have at least once committed any of te 9 types of Exam academic misconduct recorded in the dataset. if there are no true outcomes in the observation row i would like the new variable outcome to read as "false" meaning that they (the observation row) has never committed Exam academic misconduct
what I have for this new variable's code is
surveySP15$ExamMC = any(surveySP15$ExamMC.A, surveySP15$ExamMC.B, surveySP15$ExamMC.C, surveySP15$ExamMC.D, surveySP15$ExamMC.E, surveySP15$ExamMC.F, surveySP15$ExamMC.G, surveySP15$ExamMC.H, surveySP15$ExamMC.I)
however this set up seems to be overridden by the last variable case in the string (AMC.dataset$ExamMC.I)