I am trying to work through some example code from a published paper and uploaded dataset. The data and code is from the package drcSeedGerm
I am trying to run this sample code:
library(devtools)
install_github("OnofriAndreaPG/drcSeedGerm")
library(drc)
library(drcSeedGerm)
library(lmtest)
library(sandwich)
data(rape)
head(rape)
That runs without issue. The next example is this:
modHTE<-drm(nSeeds~timeBef+timeAf+Psi,data=rape,fct=HTE1(),type="event")
colnames(rape)
I get the error message:
Error in [.data.frame`(temp, , 3) : undefined columns selected
In the paper, they say: We can see that the data need to be grouped by assessment interval: ’timeBef’ and ’timeAf’ are respectively the beginning and ending of the scoring intervals (in days),’nSeeds’ is the number of germinated seeds. The ’propCum’ columns contains the cumulative proportions of germinated seeds and it is not necessary for time-to-event models. The HTE model is fit by using the functionHTE1(). No starting values are necessary,as a self-starting routine has been built into the model definition.
Am I missing something needed to run the drm code? I am confused why head(rape) or colnames(rape) will show me the names of the columns in the data, but the code doesn't recognize them?
colnames(rape) [1] "Psi" "Dish" "timeBef" "timeAf" "nSeeds" "nCum" "propCum"
Thank you!