...

/

Solution Review: ifelse()

Solution Review: ifelse()

In this review, we provide a detailed analysis of the solution to this problem.

Solution: Using ifelse()

Press + to interact
R
testVariable <- c (2, 10, 7, 400)
cat(ifelse(testVariable %% 2 == 0, "even", "odd"))

Explanation

The testVariable in ...