I would like to force render a smoother line for this multi-group plot, even in situations where a group has only one or two values. see below:
library(ggplot2)
set.seed(1234)
df <- data.frame(group = factor(c(rep("A",3),rep("B",2),"C")), x = c(1,2,3,1,2,2), value = runif(6))
ggplot(df,aes(x=x,y=value,group=group,color=group))+
geom_point(size=2)+
geom_line(stat="smooth",method = "loess",size = 2, alpha = 0.3)
Here's The output I want to see:
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…