Tushar Garg
2018-05-22 20:02:52 UTC
How can I give some name to a combination of factors.
Thanks
Tushar
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks
Tushar
mtcars$gear = factor(mtcars$gear)
mtcars$carb = factor(mtcars$carb)
ggplot(mtcars, aes(x=hp, y=disp, shape=gear, colour=carb)) +
geom_point() +
geom_line(aes(group=interaction(carb,gear)))
-Winston
--mtcars$carb = factor(mtcars$carb)
ggplot(mtcars, aes(x=hp, y=disp, shape=gear, colour=carb)) +
geom_point() +
geom_line(aes(group=interaction(carb,gear)))
-Winston
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()
--
You received this message because you are subscribed to the ggplot2
mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
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()
--
You received this message because you are subscribed to the ggplot2
mailing list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.