Reputation: 2056
Is there an equivalent building block in R for
if ($a > $b) {
echo "a is bigger than b";
} elseif ($a == $b) {
echo "a is equal to b";
} else {
echo "a is smaller than b";
}
from PHP or Java?
Upvotes: 0
Views: 198
Reputation: 46
It's not idiomatic but the answer is yes:
if (a > b) {
cat("a is bigger than b")
} else if (a == b) {
cat("a is equal to b")
} else {
cat("a is smaller than b")
}
Upvotes: 3