Friday, July 8, 2016

OR statement in R


x = 1; y = -2
if( x > 0 | y > 0) {
  print ( "TRUE :: x > 0 | y > 0")
} else {
  print ( "FALSE :: x > 0 | y >0")
}
## [1] "TRUE :: x > 0 | y > 0"

x = -1; y = -2
if( x > 0 | y > 0) {
  print ( "TRUE :: x > 0 | y > 0")
} else {
  print ( "FALSE :: x > 0 | y >0")
}

## [1] "FALSE :: x > 0 | y >0"

No comments:

Post a Comment