我正在尝试绘制一些已符合drm()
R 中 drc 包中的函数的数据。我希望在同一个图中有几条曲线相互重叠。
我可以得到一条拟合曲线,其余的不拟合成这样的曲线:
#This is only mock data to show the concept
library(drc)
CurveData1 <- c(1, 1.1, 1.2, 1.3,2,3,4,5,5.2,5.4, 5.5, 5.6)
CurveData2 <- c(2, 2.1, 2.2, 2.3,3,4,5,6,6.2,6.4, 6.5, 6.6)
CurveData3 <- c(3, 3.1, 3.2, 3.3,4,5,6,7,7.2,7.4, 7.5, 7.6)
Conc <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
fit1 <- drm(CurveData1 ~ Conc, fct = LL.5())
plot(fit1, col = "black")
lines(CurveData2, Conc, col = "orange", type = "b")
lines(CurveData3, Conc, col = "blue", type = "b")
但是,当我尝试将所有拟合曲线放入同一个图中时,如下所示:
#This is only mock data to show the concept
library(drc)
CurveData1 <- c(1, 1.1, 1.2, 1.3,2,3,4,5,5.2,5.4, 5.5, 5.6)
CurveData2 <- c(2, 2.1, 2.2, 2.3,3,4,5,6,6.2,6.4, 6.5, 6.6)
CurveData3 <- c(3, 3.1, 3.2, 3.3,4,5,6,7,7.2,7.4, 7.5, 7.6)
Conc <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
fit1 <- drm(CurveData1 ~ Conc, fct = LL.5())
fit2 <- drm(CurveData2 ~ Conc, fct = LL.5())
fit3 <- drm(CurveData3 ~ Conc, fct = LL.5())
plot(fit1, col = "black")
lines(fit2, col = "orange", type = "b")
lines(fit3, col = "blue", type = "b")
我收到以下错误消息:
xy.coords(x, y) 中的错误:“x”是一个列表,但没有组件“x”和“y”
知道为什么会发生这种情况以及如何解决它吗?是lines()
功能限制还是plot()
功能限制?