R ifelse()
Here, we are going to have a look at the method "ifelse()" provided by R language.
Most of the programs written in R language involve some kind of manipulation of vectors. Vectors are basic R Objects.
Use of ifelse()
Function
Now, imagine a case where we have to write if...else
statement for each element present in a vector. This task can be easily and efficiently coded using ifelse()
. It is the vector equivalent form of the ...