我正在使用ggplot2包创建一个图,其中包含四个不同的回归,这些回归适用于stat_smooth(),如下所示:

ggplot(NULL, aes(x = time, y = shoot)) + 
stat_smooth(data = data.0.cr, method = "lm", formula = y ~ I(x), se = FALSE, linetype = "F1", color = "black") + 
stat_smooth(data = data.0.pr, method = "lm", formula = y ~ I(x^2) + I(x^3), se = FALSE, linetype = "solid", color = "black") + 
stat_smooth(data = data.35.cr, method = "lm", formula = y ~ I(x), se = FALSE, linetype = "dotted", color = "black") + 
stat_smooth(data = data.35.pr, method = "lm", formula = y ~ I(x) + I(x^2) + I(x^3), se = FALSE, linetype = "12345678", color = "black")

我的一个data.frame看起来像这样(我为每个stat_smooth()指定了一个数据):

dose time genotype block  shoot
0     0   cr       1      120.3168
0     0   cr       2      123.0590
0     0   cr       3      108.0160
0     1   cr       1      103.3750
0     1   cr       2      146.7620
0     1   cr       3      92.5630
0     4   cr       1      83.2540
0     4   cr       2      131.2680
0     4   cr       3      122.0290
0     7   cr       1      136.7460
0     7   cr       2      136.5300
0     7   cr       3      115.0080

由于每个因素需要以不同的方式拟合,我写了四个stat_smooth()并区分每个因素我使用了四种不同的线型 .

我想包括的是每个回归图中的点 . 换句话说,我想定义如下的行:

Reg1:实线和三角形
Reg2:虚线和三角形
Reg3:实线和圆圈
Reg4:虚线和圆圈 .

是否可以这样做而不是定义不同类型的线型? (使用一些geom_point()或类似的)

先感谢您!