jeudi 16 juin 2016

Error in when merging 2 data-frames and assigning values in Score column

here below i have written code to merge two data frames & assign values 3 & -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 ,NA, ifelse(candidate_score$Correct.Option.ID == Full Marks ,3,NA)))

I am having student data, but when am assigning marks but it showing the below error unused argument how do i correct it to remove the error help is appreciated...

  Error in ifelse(candidate_score$correct == FALSE, -1, NA, ifelse(candidate_score$Correct.Option.ID ==  : 
      unused argument (ifelse(candidate_score$Correct.Option.ID == Full Marks, 3, NA))

Aucun commentaire:

Enregistrer un commentaire