grDevices::grey could provide clearer error message when length(alpha) != length(level)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

grDevices::grey could provide clearer error message when length(alpha) != length(level)

Hugh Parsonage
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: grDevices::grey could provide clearer error message when length(alpha) != length(level)

Duncan Murdoch-2
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel