Edit: found a solution to my problem! See answer below.
I have the following code that I'm trying to compile in R using the easyGgplot2 package:
ggplot2.scatterplot(data, xName='X', yName='Y', addRegLine=TRUE, groupName='DifferentClasses') +
geom_point(aes(shape=DifferentClasses, color=DifferentClasses))+
scale_shape_manual(values=c(7, 10, 19))+
scale_color_manual(values=c('red','red','red'))
The scatterplot has the following characteristics (which I am being able to replicate correctly):
- 3 regression lines for different classes
- 3 different shapes for points
- Same color for all regression lines
What I am not being able to do is to change regression lines of classes "2" and "3" to different linetypes, say "dotdash" and "dotted".
I've already tried a bunch of different combinations for funcion linetype() but I wasn't able to get it working.
Anybody could help?