R中有没有办法找出图中多条线的“一般”方程?下图是我想要实现的示例。我只显示了 t 的主线,但在这些主线之间也有隐藏线。我想要的是得到线条的“一般”方程。我该怎么做呢?
library(reshape2)
library(ggplot2)
a<-data.frame(c =c(0.01,0.02,0.03,0.05,0.07,0.10,0.15,0.20,0.30,0.50,0.70,1),
t1 =c(5,5.55,5.94,6.53,6.98,7.54,8.29,8.90,9.92,11.51,12.80,14.46),
t2 = c(4.35,4.84,5.19,5.72,6.12,6.62,7.29,7.84,8.74,10.16,11.33,12.80),
t3 = c(3.70, 4.13,4.44,4.89,5.25,5.68,6.26,6.73,7.52,8.74, 9.74,10.99),
t4 = c(3.08,3.45,3.70,4.09,4.39,4.75,5.23,5.63,6.28,7.28,8.09,9.11),
t5 = c(2.51,2.80,3.01,3.33,3.57,3.86,4.25,4.56,5.07,5.85,6.54,7.19))
b<-melt(a, id = "c")
ggplot(b,aes(x = c, y = value, color = variable)) +
geom_line() + scale_color_discrete(name= expression('t'), labels=c("t = 1", "t = 2", "t = 3", "t = 4","t = 5"))