From @|ex@ndre@court|o| @end|ng |rom gm@||@com  Sun May 26 10:45:06 2019
From: @|ex@ndre@court|o| @end|ng |rom gm@||@com (Alexandre Courtiol)
Date: Sun, 26 May 2019 10:45:06 +0200
Subject: [Rd] "if" function in pure R?
Message-ID: <CAERMt4fyeJ293njYHCFVZhYpm1Y8NaU8NSZ+Q3OFY2jopLMUEg@mail.gmail.com>

Hi all,

Could anyone refer to me to a good source to learn how to program a simple
control-flow construct* in R, or provide me with a simple example?

Control-flow constructs are programmed as primitives, but I would like to
be able to do that (if possible) in pure R.

The general context is that those functions are a mystery to me. The
motivating example is that I would like to create a function that behave
similarly to base::`if` with an extra argument to the function (e.g. to
include an error rate on the condition).

Many thanks,

Alex

* control-flow constructs are functions such as if, for, while... that
allow for call of the form fn(x) expr to work (see ?Control).

-- 
Alexandre Courtiol

http://sites.google.com/site/alexandrecourtiol/home

*"Science is the belief in the ignorance of experts"*, R. Feynman

	[[alternative HTML version deleted]]



[Rd] "if" function in pure R?
Alexandre Courtiol