lundi 16 mars 2020

I am getting length error while executing if else condition in R

On executing the below code .I am getting error: In if (x <= 5) { : the condition has length > 1 and only the first element will be used

Code:if(sales<=5){
          x="Lower"
        }else if(sales>5& sales<=8){
          x="Medium"
        }else{
          x="Higher"}

Aucun commentaire:

Enregistrer un commentaire