Re: [R] Graphing question/possibly lattice/xyplot

From: Deepayan Sarkar <deepayan_at_stat.wisc.edu>
Date: Thu 03 Mar 2005 - 10:29:10 EST

On Wednesday 02 March 2005 16:24, Erin Hodgess wrote:
> Dear R People:
> I have a data frame with the variables calories, sodium and "type",
> where type is either zero or one.
>
> I would like to produce a scatterplot with sodium on the horizontal,
> calories on the vertical and have the dots be clear when type is one
> and black when type is zero.
>
> It can be done via lines and points, but I was wondering if there is
> a better way with lattice graphics.

How about something like

xyplot(calories ~ sodium,

       groups = type, 
       col = 'black',
       pch = c(16, 1))

?

-Deepayan



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Mar 03 11:00:57 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:39 EST