mercredi 16 octobre 2019

R ifelse() function not picking up values in condition

I have an R vector called results which has 20 values that resulted from 20 different divisions. Some of the divisions produced a whole number 1, yet when I run ifelse(results == 1,1,0), the output is all 20 values as FALSE. If I counted well, there are six 1 values, so there should be six TRUE statements in the output. I'm attaching an image showing the contents of the results vector and the output of the ifelse(results == 1,1,0) operation: enter image description here

Please help, and thanks for your patience.

Aucun commentaire:

Enregistrer un commentaire