0

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
Pershang
  • 1
  • 2
  • I think you might need `Germination ~ Dose + Trt + Timing` as the first argument? Could we have a [mcve] please ... ? – Ben Bolker Nov 01 '21 at 23:23
  • I tried to make a minimal but its impossible. I run Germination ~ Dose + Trt + Timing and I only got 3 parameters with this warning "Warning message: In sqrt(diag(varMat)) : NaNs produced". I run "Germination ~ Dose + Trt ,Timing" and I got all the parameters but they are not correct with the same warning message – Pershang Nov 03 '21 at 02:20
  • I am getting this warning too. In cbind(-t1 * xlogx(dose/parmMat[, 4], parmMat[, 1], parmMat[, : number of rows of result is not a multiple of vector length (arg 1) – Pershang Nov 03 '21 at 02:36

0 Answers0