Below I have code to merge two data frames and assign values 3 and -1,
candidate_score<-merge(check7,anskey,by='Question.ID')
candidate_score$correct <- candidate_score$Selected.Option.ID == candidate_score$Correct.Option.ID
candidate_score$score <-
ifelse(candidate_score$correct== TRUE, 3,
ifelse(candidate_score$correct== FALSE, -1, ifelse(candidate_score$Correct.Option.ID == Full Marks ,3,NA)))
I am having student data, when am assigning marks 3,-1 according to candidate_score$score data frame its shown below the marks 3 is not assigned to Full Marks in correct.option.idcolumn according to my candidate_score$score code how can i achieve my desired output?
i want to also assign 3 marks wherever correct.option.id has Full Marks.