[R] if-else that returns vector

Christofer Bogaso bog@@o@chr|@to|er @end|ng |rom gm@||@com
Thu Oct 12 22:22:03 CEST 2023


Following expression returns only the first element

ifelse(T, c(1,2,3), c(5,6))

However I am looking for some one-liner expression like above which
will return the entire vector.

Is there any way to achieve this?

More information about the R-help mailing list