[R] matrix and error in points, plot ?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Jan 3 09:20:56 CET 2005
You have forgotten drop=FALSE in mat[1,]: take a look at what it produces.
See ?Extract for more details.
On Mon, 3 Jan 2005, Patrick Giraudoux H wrote:
> Would a specialist of the "point" or "plot" functions try the following:
>
> mat<-matrix(c(1.836767,4.025989,0.6396777,0.3764444),ncol=2)
> plot(mat)
> points(mat[1,],col="red")
>
> ..A lag appears on x for mat [1,1] between the two displays.
>
> I wonder if this example may be due to a bug or to the mis-use of a matrix in
> the plot() points() functions. In case of mise-use which kind can it be?
Not using a matrix at all!
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list