there is no package called ‘deSolve’
You need to install the deSolve
package by running the command install.packages("deSolve")
.
could not find function "ode"
You need to load the deSolve
package by running the command library(deSolve)
.
object 'E' not found
You’re trying to use an object that does not yet exist. If it is a compartment (S
, E
, I
, R
, etc.), you have likely forgotten to change your initial values to include this compartment.
unexpected symbol in ...
Your command is most likely missing a comma or some other separator. Check the command that is specified again. For example: Error: unexpected symbol in "inits <- c(S = 999999, E = 0 I"
is missing a comma before the I
.
undefined columns selected
You are trying to call a column that does not exist. Check your subsetting that the columns you are trying to call either by slicing (e.g., df[, 1:5]
) or by name (e.g., df$I
) actually exist in the object.
matplot()
Check to make sure your y =
argument includes all columns you intended.
matplot()
lines are weird (i.e., dotted, dashed, etc.)Check to make sure you specified the l
inety
pe you wanted with the lty = 1
argument.
Your timescale and parameters likely do not make sense. Check that your rates (relative to your timescale) are correct. Also check that you’re running it for long enough and using small enough increments.
The number of derivatives returned...
You may have forgotten to return one of your compartments. Check that your model function returns the same number of objects as compartments. For example, der <- c(dS, dI, dR))
with inits <- list(S = 999, E = 0, I = 1, R = 0)
won’t work because you’re specifying four initial compartments, but only returning three.