-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Hi,
I am trying to run a DEB model for Perna canaliculus using the rundeb
function, but I get the following error:
deb <- rundeb(
species = species,
ndays = ndays,
div = div,
Tbs = Tbs,
clutchsize = clutchsize,
Xs = Xs,
mass.unit = mass.unit,
length.unit = length.unit,
start.stage = start.stage,
E_sm = E_sm,
plot = plot
)
NOTE: No length data in parameter estimation, assuming del.M of 0.2, predictions of physical lengths are suspect.
Error in if (H < E_Hb) { : missing value where TRUE/FALSE needed
This is the code I am using, based on the tutorial here: https://mrke.github.io/NicheMapR/inst/doc/deb-model-tutorial
library(NicheMapR)
# Load saved data
load("C:/Users/javiera/OneDrive - Cawthron/Stats/others/allstat.Rda")
# Get all species names
allDEB.species <- unlist(labels(allStat$allStat))
allDEB.species <- allDEB.species[1:(length(allDEB.species) - 2)]
head(allDEB.species)
allDEB.species[str_detect(allDEB.species, "Perna.canaliculus")]
species <- "Perna.canaliculus"
species.slot <- which(allDEB.species == species)
par.names <- unlist(labels(allStat$allStat[[species.slot]]))
for (i in seq_along(par.names)) {
assign(par.names[i], unlist(allStat$allStat[[species.slot]][i]))
}
# Model parameters
ndays <- 365 * 3
div <- 1
Tbs <- rep(25, ndays * div)
starvetime <- 0
X <- 100
Xs <- c(
rep(X, ndays * div / 2),
rep(0.000005, starvetime),
rep(X, ndays * div / 2 - starvetime + 1)
)
E_sm <- 350
clutchsize <- 5
mass.unit <- "g"
length.unit <- "mm"
plot <- 1
start.stage <- 1
deb <- rundeb(
species = species,
ndays = ndays,
div = div,
Tbs = Tbs,
clutchsize = clutchsize,
Xs = Xs,
mass.unit = mass.unit,
length.unit = length.unit,
start.stage = start.stage,
E_sm = E_sm,
plot = plot
)
Could you please advise what might be causing this error and whether I need to manually add certain species parameters for P. canaliculus?
Thanks,
Javier
Metadata
Metadata
Assignees
Labels
No labels