Re: [R] Ploting two datasets

From: Petr Pikal <>
Date: Thu 25 May 2006 - 16:16:03 EST


On 25 May 2006 at 0:25, Anderson de Rezende Rocha wrote:

Date sent:      	Thu, 25 May 2006 00:25:46 -0300 (ART)
From:           	Anderson de Rezende Rocha <>
Subject:        	[R] Ploting two datasets

> Dears,
> I need your help. I have two sets A and B each one containing
> n lines and being composed by the atributes x and y.

Well do you really mean attributes? Maybe they are data frames.

> Three questions:
> 1) How can I plot A and B both on the same graphic? I need to show
> that the classes A and B are separable. In this way, I need
> to plot the points of A as "*", and the points of B as "+", for
> example. This would result two clouds.

A<-data.frame(x=1:10, y=rnorm(10)
B<-data.frame(x=1:10, y=rnorm(10)*10

plot(A$x, A$y, ylim=range(A$y, B$y), pch=8) points(B$x, B$y, ylim=range(A$y, B$y), pch=3)

or maybe you could use Rgobi (Ggobi).

> 2) How can I plot the result of question one using multi-levels, that
> is, a set of ellipsis that start on the mean of A and on the
> mean of B?

see package elipse or make your own function which takes means and draws an ellipse with some setted axes

> 3) How can I trace an hiperplane separating the classes A and B just
> depicted in question 1?
> I appreciate any help. Thanks for all.
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!

Petr Pikal mailing list PLEASE do read the posting guide! Received on Thu May 25 16:26:59 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 May 2006 - 18:10:32 EST.

Mailing list information is available at Please read the posting guide before posting to the list.