在 DRC 包中,我试图将运行 ED 函数得到的输出添加到我放置在 DRM 图上的文本框中。关于如何编写脚本的任何想法,以便我可以在文本函数中包含 ED 函数并自动将结果放置到图上?
这是我到目前为止尝试过的代码:
dayone <- structure(list(hours = c(24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L,
24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L, 24L,
24L, 24L, 24L, 24L, 24L, 24L, 24L), jarnum = c(NA_character_,
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
NA_character_, NA_character_, NA_character_, NA_character_, NA_character_,
NA_character_, NA_character_), treat = c(0L, 0L, 0L, 0L, 1500L,
1500L, 1500L, 1500L, 3000L, 3000L, 3000L, 3000L, 4000L, 4000L,
4000L, 4000L, 5000L, 5000L, 5000L, 5000L, 6000L, 6000L, 6000L,
6000L, 10000L, 10000L, 10000L, 10000L), rep = c(1L, 2L, 3L, 4L,
1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L,
1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L), total = c(5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L), mort = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 1L, 1L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L), cummort = c(0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 1L, 1L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L)), .Names = c("hours", "jarnum", "treat",
"rep", "total", "mort", "cummort"), row.names = c(NA, -28L), class = c("tbl_df",
"tbl", "data.frame"))
drmdayone <- drm(cummort/total~treat, data=dayone, fct=LL.2(), type="binomial")
plot(drmdayone, type="all", pch=16, lwd=2,log="x", main="Acute DRC - 24 Hours",xlab="[Cl-] (mg/L)", ylab="Mortality", axes=F)
axis(1, c(1500,3000,4000,5000,6000,10000))
axis(2, c(0,0.1,0.5,1))
text(500, 0.6, "Here is where I want the ED function (below) results to be displayed", font=2)
ED(drmdayone, c(10,50,90))