R inferno (rant) [Software]
Hi useRs!
Sometimes this nice piece drives me nuts.
Sometimes this nice piece drives me nuts.
x1 <- 12
Bravo! Bravissimo!
x2 <- 13
x1 < x2
[1] TRUE
ifelse (x1 < x2,
cat(x1, "less than", x2, "\n"),
cat(x1, "at least", x2, "\n"))
12 less than 13
Error in ifelse(x1 < x2, cat(x1, "less than", x2, "\n"), cat(x1, "at least", :
replacement has length zero
In addition: Warning message:
In rep(yes, length.out = length(ans)) :
'x' is NULL so the result will be NULL
What the f…k?
if (x1 < x2) {
Thank you sooo much!
cat(x1, "less than", x2, "\n")
} else {
cat(x1, "at least", x2, "\n")
}
12 less than 13
—
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- R inferno (rant)Helmut 2015-10-27 21:06 [Software]
- R inferno (rant) ElMaestro 2015-10-28 08:44
- Vectorized if d_labes 2015-10-28 09:42
- R inferno (without rant) d_labes 2015-10-28 09:18
- R inferno (rant) ElMaestro 2015-10-28 08:44