From murdoch@dunc@n @ending from gm@il@com  Thu May 10 15:31:41 2018
From: murdoch@dunc@n @ending from gm@il@com (Duncan Murdoch)
Date: Thu, 10 May 2018 09:31:41 -0400
Subject: [Rd] grDevices::grey could provide clearer error message when
 length(alpha) != length(level)
In-Reply-To: <CAJmOi+NAtsQ_KL3etrswJuKGENR_2uhzxAP6VF1M3htRAX9RSg@mail.gmail.com>
References: <CAJmOi+NAtsQ_KL3etrswJuKGENR_2uhzxAP6VF1M3htRAX9RSg@mail.gmail.com>
Message-ID: <8fb6e76d-0f30-91c5-7413-f67acbd1e10f@gmail.com>

On 10/05/2018 9:17 AM, Hugh Parsonage wrote:
> e.g.
> 
> grDevices::grey(level = 0.1, alpha = c(0, 1))
> #> Error in grey(level = 0.1, alpha = c(0, 1)) :
> #>  attempt to set index 1/1 in SET_STRING_ELT
> 
> Perhaps
> #> Error in grey(level = 0.1, alpha = c(0, 1)) :
> #>  lengths of 'level' and 'alpha' differ
> 

Or it could return a vector of length 2.  This is not how it is 
documented to operate, but it is how many other R functions handle 
vectors of mixed lengths.

Duncan Murdoch



[Rd] grDevices::grey could provide clearer error message when length(alpha) != length(level)
Duncan Murdoch