From murdoch.duncan at gmail.com  Wed Sep 14 19:09:37 2016
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Wed, 14 Sep 2016 13:09:37 -0400
Subject: [Rd] R-intro: length of 'ifelse' result
In-Reply-To: <1598036366.967396.1473866135477@mail.yahoo.com>
References: <1598036366.967396.1473866135477.ref@mail.yahoo.com>
	<1598036366.967396.1473866135477@mail.yahoo.com>
Message-ID: <d9a668d0-218c-de9f-ed3c-e8338ae09819@gmail.com>

On 14/09/2016 11:15 AM, Suharto Anggono Suharto Anggono via R-devel wrote:
> In "An Introduction to R" Version 3.3.1, in "9.2.1 Conditional execution: if statements", the last paragraph is the following:
> There is a vectorized version of the if/else construct, the ifelse function. This has the form ifelse(condition, a, b) and returns a vector of the length of its longest argument, with elements a[i] if condition[i] is true, otherwise b[i].
>
>
> In fact, ifelse(condition, a, b) returns a vector of the length of 'condition', even if 'a' or 'b' is longer.

Thanks, I'll fix that.

Duncan Murdoch



[Rd] R-intro: length of 'ifelse' result
Duncan Murdoch