# \donttest{
data(pyrola)
pyrola$species <- as.factor(pyrola$species)
pyrola$population <- as.factor(pyrola$population)
jreg <- pyrola[which(pyrola$population == 1),]
stagevec_jp <- c("P1", "Sdl", "Dorm", "V0nr", "V1nr", "V2nr", "V3nr", "V4nr",
"V0r", "V1r", "V2r", "V3r", "V4r")
sizeavec_jp <- c(0, 0, 0, 0, 1, 2, 3, 7, 0, 1, 2, 3, 7)
sizeahbin_jp <- c(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 3.5, 0.5, 0.5, 0.5, 0.5,
3.5)
repvec_jp <- c(0, 0, 0, 0, rep(0, 4), rep(1, 5))
propvec_jp <- c(1, rep(0, 12))
immvec_jp <- c(1, 1, rep(0, 11))
matvec_jp <- c(0, 0, rep(1, 11))
obsvec_jp <- c(0, 0, 0, rep(1, 10))
indata_jp <- c(0, 0, rep(1, 11))
comments_jp <- c("protocorm", "seedling", "dormant adult", "stump", "1lf nr",
"2lf nr", "3lf nr", "4+lf nr", "0lf r", "1lf r", "2lf r", "3lf r",
"4+lf r")
jp_frame <- sf_create(sizes = sizeavec_jp, stagenames = stagevec_jp,
binhalfwidth = sizeahbin_jp, repstatus = repvec_jp, obsstatus = obsvec_jp,
indataset = indata_jp, propstatus = propvec_jp, immstatus = immvec_jp,
matstatus = matvec_jp, comments = comments_jp)
jhfv <- verticalize3(data = jreg, noyears = 6, firstyear = 2015,
individcol = "id", blocksize = 8, sizeacol = "lvs.num.2015",
obsacol = "sprouted.2015", repstracol = "flo.tot.2015",
repstrbcol = "frt.tot.2015", fecacol = "flo.tot.2015",
fecbcol = "frt.tot.2015", NAas0 = TRUE, stagesize = "sizea",
stageassign = jp_frame)
jp_models_ah <- modelsearch(data = jhfv, stageframe = jp_frame,
suite = "full", vitalrates = c("surv", "obs", "size", "repst", "fec"),
fec = c("fec3added", "fec2added"), sizedist = "poisson",
fecdist = "negbin", fec.trunc = TRUE, historical = FALSE,
quiet = "partial")
jp_germ <- 0.90
jp_supp2 <- supplemental(stage3 = c("Sdl", "Dorm", "V0nr", "V1nr", "P1", "Sdl"),
stage2 = c("P1", "Sdl", "Sdl", "Sdl", "rep", "rep"),
eststage3 = c(NA, NA, NA, NA, NA, NA),
eststage2 = c(NA, NA, NA, NA, NA, NA),
givenrate = c(0.25, 0.35, 0.10, 0.10, NA, NA), # 0.345, 0.054
multiplier = c(NA, NA, NA, NA, jp_germ * 0.5, jp_germ * 0.5),
type = c(1, 1, 1, 1, 3, 3), stageframe = jp_frame, historical = FALSE)
jp_ahmpm <- flefko2(year = "all", stageframe = jp_frame,
supplement = jp_supp2, modelsuite = jp_models_ah, data = jhfv,
err_check = TRUE)
lambda3(jp_ahmpm)
# }
Run the code above in your browser using DataLab