[R] multiple uses ifelse function

Jorge Cimentada cimentadaj at gmail.com
Tue Oct 11 11:46:50 CEST 2016


Hi Letter,

This should do it:
testchange <- ifelse(testseq <= 4,'x', ifelse(testseq >= 5, 'y', testseq))

Read it as: if testseq <=4, print x, ifelse test seq >=5, print y, any
other case, print testseq.

	[[alternative HTML version deleted]]



More information about the R-help mailing list