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

posted by mittyri – Russia, 2019-04-27 22:23  – Posting: # 20253
Views: 2,103

(edited by mittyri on 2019-04-27 23:47)

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:

Activity
 Mix view
Bioequivalence and Bioavailability Forum |  Admin contact
19,888 posts in 4,215 threads, 1,364 registered users;
online 8 (0 registered, 8 guests [including 5 identified bots]).
Forum time (Europe/Vienna): 22:20 CEST

The real purpose of the scientific method is to make sure
nature hasn’t misled you into thinking you know something
you actually don’t know.    Robert M. Pirsig

The BIOEQUIVALENCE / BIOAVAILABILITY FORUM is hosted by
BEBAC Ing. Helmut Schütz
HTML5