[R] Unexpected warning from matplot

Mario Valle mvalle at cscs.ch
Wed Apr 21 16:36:37 CEST 2010


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?

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'))) {

Best regards
		mario

P.S.: R 2.9 on Win and Linux

-- 
Ing. Mario Valle
Data Analysis and Visualization Group            | 
http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82



More information about the R-help mailing list