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

posted by mittyri  – Russia, 2019-04-28 00:23 (2612 d 01:04 ago) – Posting: # 20253
Views: 11,751

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,655 posts in 4,993 threads, 1,571 registered users;
123 visitors (0 registered, 123 guests [including 10 identified bots]).
Forum time: 01:27 CEST (Europe/Vienna)

Science is simply common sense at its best that is,
rigidly accurate in observation, and
merciless to fallacy in logic.    Thomas Henry Huxley

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