mardi 1 octobre 2019

If-else statement in R to describe three different cases

What is an efficient way to describe three different cases for x<y, x>y and x=y? Here x and y are two numbers. I thought the following:

if (x<y) {
  ...
}
if (x>y) {
  ...
}
if (x=y) {
  ...
}

Maybe I could use ifelse statement?

Aucun commentaire:

Enregistrer un commentaire