Christian Rummey
unread,May 23, 2012, 11:21:08 AM5/23/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggp...@googlegroups.com
dear all!
I have data grouped by two factors, let's say gear and carb (see below).
To connect the points per group, I can either use
group=carb
OR
group=gear
But what I need is something like group=c(carb + gear) to connect only the dots that have both factors in common.
I could create a new column, but there must be another way to do this...
Many thanks
- Christian
mtcars$gear = factor(mtcars$gear)
mtcars$carb = factor(mtcars$carb)
ggplot(mtcars) +
aes(hp,disp)+
aes(shape = gear) +
aes(color = carb) +
aes(group=carb) +
geom_point()+
geom_line()