Skip to content

color by group in ggplot

1 message · David Winsemius

#
On May 3, 2013, at 1:57 PM, Ye Lin wrote:

            
You didn't say what class the ID variable was, but if it were a factor ( as is most likely), then:

plot(  as.numeric(dfrm$ID), Var1)
points( as.numeric(dfrm$ID), Var2) 

With whatever means of disiguishing overlapping points (pch, col, jittering)  might suit you.