lundi 20 juin 2016

R if else statement: Does the line on which brackets are matter?

I write my if else statement in R in the following way as I find it more readable. Can the below style cause any issue?

if (2==1) 
{
     print("1")
} 
else if (2==2) 
{
     print("2")
} 
else 
{
     print("3")
}

Thanks for your help,

Aucun commentaire:

Enregistrer un commentaire