Skip to content
Back to formatted view

Raw Message

Message-ID: <200503021729.10189.deepayan@stat.wisc.edu>
Date: 2005-03-02T23:29:10Z
From: Deepayan Sarkar
Subject: Graphing question/possibly lattice/xyplot
In-Reply-To: <200503022224.j22MOnc29206@gator.dt.uh.edu>

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