I have trouble plotting multiple model drm in the R package DRC.
My data comprises of three variables; Doses; Herbicide (Trt) and Timing
The dose response curve works fine when I plot Dose and Trt, but when I add Timing I am getting this error: Error in pmodelsList[[i]] : subscript out of bounds here is my code:
library(pacman)
library(dplyr)
p_load(MASS,
drc,
ggplot2,
reshape2)
t1= read.csv('TimingBB.csv',sep = ",",header=TRUE,strip.white=TRUE)
t2 <- melt(t1,id.vars=c('Dose', 'Rep', 'Timing'), variable.name = "Trt", value.name = 'Germination')
ggplot(t2, aes(x=Dose, y=Germination, color=Timing))+
geom_point()+
facet_wrap(~Trt,nrow = 3)
modl_Full <-drm(Germination~Dose,Trt,Timing, data = t2, fct = LL.3()) # Full model