[R] How to define mutualy exclusive parameters of a function

Rui Barradas ru|pb@rr@d@@ @end|ng |rom @@po@pt
Thu Apr 26 18:45:05 CEST 2018


Hello,

Inline.

On 4/26/2018 5:42 PM, Berry, Charles wrote:
> 
> 
>> On Apr 26, 2018, at 6:46 AM, Polychronis Kostoulas <polychronis.kostoulas using gmail.com> wrote:
>>
>> Dear All,
>> apologies if this is basic: I am writing a function:
>>
>> fb<-function(mean, median, mode, a, b=0.95, lower=F)
>> {....}
>>
>> The arguments mean, median and mode are mutually exclusive (i.e. the user
>> should define only one of these). How do I code this within the function?
>>
> 
> See
> 
> ?missing

See also the first example in help("switch")

Hope this helps,

Rui Barradas


> 
> HTH,
> 
> Chuck
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>




More information about the R-help mailing list