magik of R implicit return [🇷 for BE/BA]

posted by mittyri – Russia, 2019-04-28 00:23 (1985 d 22:43 ago) – Posting: # 20253
Views: 7,403

Dear Detlew!

❝ Do you have the thousand sentences for me?

I have many of those, but for clarity I prefer a simplified version what was going on:

veryspecialfunction <- function(flag) {
  if (flag == 1) {
    "one"
  }
 
  if (flag == 2){
    "two"
  } 
}

Now running:
veryspecialfunction(2)
[1] "two"

veryspecialfunction(1)
# nothing here!
typeof(veryspecialfunction(1))
[1] "NULL"

Kind regards,
Mittyri

Complete thread:

UA Flag
Activity
 Admin contact
23,240 posts in 4,884 threads, 1,655 registered users;
66 visitors (0 registered, 66 guests [including 8 identified bots]).
Forum time: 23:06 CEST (Europe/Vienna)

The epistemological value of probability theory is based on the fact
that chance phenomena, considered collectively and on a grand scale,
create non-random regularity.    Andrey Kolmogorov

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