Vectorized if [Software]

posted by d_labes  – Berlin, Germany, 2015-10-28 10:42 (3466 d 05:57 ago) – Posting: # 15587
Views: 7,176

Hi Öberster Größter Meister!

❝ I agree ifelse(a,b,c) is a borderline silly function.


Disagree. Very handy function if vectorized if is needed. Used it myself heavily in my codes for simulations.

❝ Like you I'd much prefer the classical if else construct.


Typical for coders coming from C, Fortran or so relying mostly on for loops and without vector constructs :cool:.
Will not work in R if you have vectors to compare. See "R Inferno" Circle 3.2, link in my post to Helmut.

❝ I think this also goes to show that error messages should be user-friendly.


Full ACK. Here R is as obscure or even more obscure as other languages. See here.

Regards,

Detlew

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,669 registered users;
25 visitors (0 registered, 25 guests [including 5 identified bots]).
Forum time: 17:39 CEST (Europe/Vienna)

Most scientists today are devoid of ideas, full of fear, intent on
producing some paltry result so that they can add to the flood
of inane papers that now constitutes “scientific progress”
in many areas.    Paul Feyerabend

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