[R] Unexpected warning from matplot

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Apr 21 18:58:37 CEST 2010



On 21.04.2010 16:36, Mario Valle wrote:
> n <- 63
> a <- 1:n
> x <- a-1
> y <- outer(x,a)
> matplot(x,y,type='l')
> Warning message:
> In matplot(x, y, type = "l") :
> default 'pch' is smaller than number of columns and hence recycled
>
> Why is it complaining if I specifically ask for type="l", so no pch
> involved?
>
> Annoyance or feature?


Perhaps annoyance, if you like to be annoyed ... or just a warning that 
can be ignored since no pch is involved.


> The fix (if needed) is simple. In the matplot code change:
>
> if (is.null(pch)) {
> to:
> if (is.null(pch) & (type[1] %in% c('p','b','o'))) {


Thanks, you meant && rather than &, I suppose.


>
> Best regards
> mario
>
> P.S.: R 2.9 on Win and Linux
>


Please always try the current prerelease (to be 2.11.0 tomorrow).

Best wishes,
Uwe Ligges



More information about the R-help mailing list