你可能不太熟悉ggplot2?实际上你给的网页链接里的例子里就有啊。先把这个Clarke图画出来,然后在上面geom_abline
添加回归曲线就行了
library(ggplot2)
ceg <- plotClarkeGrid(glucose_data$ref, glucose_data$test)
myfit <- lm(test ~ ref, data = glucose_data)
coef(myfit)
ceg +
geom_abline(intercept = coef(myfit)[1],
slope = coef(myfit)[2],
linetype = "dashed",
size = 2)