Do you how the way to combine linetype and fill in legend??
Here is my dataset:
values <- runif(1200, 1, 100)
ind <- as.factor(rep(c(1:6), each=200))
inout <- as.factor(rep(c(1:2), each =600))
df <- data.frame(values,ind,inout)
ggplot(df) +
geom_density(aes(x=values, y=..density..*100, group=interaction(ind,inout), linetype=factor(inout), colour=ind), size =1, alpha=1,na.rm = TRUE) +
geom_density(aes(x=values, y=..density..*100, group=inout, linetype=factor(inout), fill=factor(inout)), alpha=.4)
The original plot:
I would like to combine the legend "factor(inout)" and legend "NA".
Thanks for your help.