I have the following plot:
ggplot(age.meaning.gender, 
       aes(Birthyear, tou.rate, color=Gender, linetype=Grammatical.Function)) +
   geom_point()+
   ylim(c(0,1)) +
   geom_smooth(method = "lm", size=2, se=FALSE)+
   xlab("Year of Birth") +
   scale_linetype_manual(values=c("dashed", "solid")) +
   scale_color_brewer(type='qual', palette = 2)+
   theme_bw()+
   theme(panel.border = element_blank(),
         panel.grid.major = element_blank(),
         panel.grid.minor = element_blank(),
         axis.line = element_line(colour = "black"))+
   guides(fill = guide_legend(keywidth = 1, keyheight = 1), 
          linetype = guide_legend(keywidth = 3, keyheight = 1), 
          colour = guide_legend(keywidth = 3, keyheight = 1))  
I am wondering if it is possible to customize the legend in a way that combines the 2 variables: "Grammatical function" and "Gender" such that we can see 4 labels:
- spatial.male: linetype 1(e.g. green solid);
- spatial.female: linetype 2 (green dashed);
- temporal.female: linetype 3;
- temporal.male: linetype 4.

 
     
    
