implicit return? [R for BE/BA]

posted by ElMaestro  – Belgium?, 2019-04-28 19:16 (543 d 01:07 ago) – Posting: # 20258
Views: 4,338

(edited by ElMaestro on 2019-04-28 19:40)

Hi Hotzi,

I even go a step further, perhaps only because I am rather dumb.

My functions almost always look like this:
Foo=function(bar)
{
  ##blah blah, conditions and functionality and loops and loads of curly braces here.
  ##whatever happens in loops and conditions it sets a variable called e.g. rslt

  return(rslt) ##I always have a line at the end that looks like this!
}


I do that to make sure that whatever happens with pairs of curly braces I know that my function return is captured at the end. When finding errors and bugs I just need to look at rslt and work backwards. print(rslt) immediately before the return statement is often a very good beginning to that. Not sure if this is smarter (in terms of error finding) but it is my solution to a lot of trouble. Possibly just owing to my own lack of skills.

In C you can also exit with curly braces in the middle of a function. Debugging that sh!t is impossible for me:-).

I could be wrong, but...

Best regards,
ElMaestro

No, of course you do not need to audit your CRO if it was inspected in 1968 by the agency of Crabongostan.

Complete thread:

Activity
 Admin contact
21,177 posts in 4,414 threads, 1,475 registered users;
online 6 (0 registered, 6 guests [including 3 identified bots]).
Forum time: Thursday 20:24 UTC (Europe/Vienna)

It is not so much that I have confidence in scientists being right,
but that I have so much in nonscientists being wrong.    Isaac Asimov

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