Skip to content
Snippets Groups Projects
Commit f4a4500b authored by thierrychambert's avatar thierrychambert
Browse files

plot_traj corrections

parent e2909c5c
No related branches found
No related tags found
No related merge requests found
......@@ -34,12 +34,16 @@ plot_traj <- function(N, age_class_use = "NotJuv0", fecundities = NULL, onset_ye
nsim <- dim(N)[4]
# Select which age classes to use for the plot
if(base::missing(age_class_use)) N <- N[-1,,,]
if(match.arg(arg = age_class_use, choices = c("all","NotJuv0", "pairs")) == "NotJuv0") N <- N[-1,,,]
if(match.arg(arg = age_class_use, choices = c("all","NotJuv0", "pairs")) == "all") N <- N
if(match.arg(arg = age_class_use, choices = c("all","NotJuv0", "pairs")) == "pairs"){
mature <- which(fecundities != 0)
N <- N[mature,,,]/2
# if(base::missing(age_class_use)) N <- N[-1,,,]
if(match.arg(arg = age_class_use, choices = c("all", "NotJuv0", "pairs")) == "NotJuv0") N <- N[-1,,,]
if(match.arg(arg = age_class_use, choices = c("all", "NotJuv0", "pairs")) == "all") N <- N
if(match.arg(arg = age_class_use, choices = c("all", "NotJuv0", "pairs")) == "pairs"){
if(is.null(fecundities)){
stop("Argument 'fecundities' is required when age_class_use = 'pairs'")
}else{
mature <- which(fecundities != 0)
N <- N[mature,,,]/2
}
}
dim(N)
......
......@@ -154,6 +154,7 @@ plot_impact(N, Legend = paste("sc", 1:length(fatalities_mean)))
x11()
plot_traj(N, age_class_use = "pairs", fecundities = fecundities,
Legend = paste("sc", 1:length(fatalities_mean)), ylim = c(0, NA))
# plot_traj(N, Legend = paste("sc", 1:length(fatalities_mean)), ylim = NULL)
Legend = paste("sc", 1:length(fatalities_mean)), ylim = c(0, NA))
###
plot_traj(N,
Legend = paste("sc", 1:length(fatalities_mean)), ylim = c(0, NA))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment