[R] ifelse

Arnaud Gaboury arnaud.gaboury at a2ct2.com
Thu Feb 9 17:37:47 CET 2012


I need to print a screen message after a test.

>ifelse(all(list %in% c(1,10,100)==TRUE),cat("YES\n"),cat("NO\n"))
Error in ifelse(all(l %in% c(1, 10, 100) == TRUE), cat("YES\n"), cat("NO\n")) : 
  replacement has length zero

I have the correct answer, YES, but with an Error.


TY for any help

Arnaud Gaboury
A2CT2 Ltd.

More information about the R-help mailing list