R inferno (rant) [Software]

posted by Helmut Homepage – Vienna, Austria, 2015-10-27 22:06 (3096 d 14:10 ago) – Posting: # 15584
Views: 8,026

Hi useRs!

Sometimes this nice piece drives me nuts.

x1 <- 12
x2 <- 13
x1 < x2
[1] TRUE
     Bravo! Bravissimo!

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) {
  cat(x1, "less than", x2, "\n")
} else {
  cat(x1, "at least", x2, "\n")
}

12 less than 13
   Thank you sooo much!


Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes

Complete thread:

UA Flag
Activity
 Admin contact
22,987 posts in 4,824 threads, 1,662 registered users;
90 visitors (0 registered, 90 guests [including 8 identified bots]).
Forum time: 13:16 CEST (Europe/Vienna)

The only way to comprehend what mathematicians mean by Infinity
is to contemplate the extent of human stupidity.    Voltaire

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5