multiplot_proj: multiplot.proj

Description Usage Arguments Value Examples

View source: R/18_multiplot_proj.R

Description

plots outputs from several projections that result from projections(), with multiple depletion levels.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
multiplot_proj(
  high.d1,
  med.d1,
  low.d1,
  high.d2,
  med.d2,
  low.d2,
  high.d3,
  med.d3,
  low.d3,
  spaghetti = FALSE,
  years.to.plot = 50,
  color.palette = c("forestgreen", "darkorange", "red"),
  lang = "en"
)

Arguments

high.d1

a list containing output from projections() (including a matrix of simulation trajectories) - this corresponds to the highest bycatch level (thus "high") and the depletion level ( d1 indicates the lowest starting depletion level)

med.d1

a list containing the middle bycatch value and lowest starting depletion

low.d1

a list containing the lowest bycatch value and lowest starting depletion

high.d2

a list containing the highest bycatch value and middle starting depletion

med.d2

a list containing the middle bycatch value and middle starting depletion

low.d2

a list containing the lowest bycatch value and middle starting depletion

high.d3

a list containing the highest bycatch value and highest starting depletion

med.d3

a list containing the middle bycatch value and highest starting depletion

low.d3

a list containing the lowest bycatch value and highest starting depletion

spaghetti

either FALSE or a number, where the number is how many simulations to show from the same scenario

years.to.plot

How many years to plot on the x axis

color.palette

A vector of length 3 giving the color values for low, medium, and high bycatch mortality or bycatch mortality rate

lang

language to use. "en" = English; "es" = Spanish; "fr" = French.

Value

A plot of 50 percent and 90 percent confidence intervals of population projections if spaghetti == FALSE or a spaghetti plot with n individual projections if spaghetti == n , from projections().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
parms <- list(S0 = 0.944, S1plus = 0.99, 
K1plus = 9000, 
AgeMat = 18, nages = 20,  
z = 2.39, lambdaMax = 1.02)
InitDepl.vec <- c(0.1, 0.5, 0.9)
BycatchCV <- 0.2
nyears <- 100

high.list <- lapply(
X = InitDepl.vec,
function(x) {
  projections(
    NOut = 50,
    ConstantRateBycatch = list(Rate = 0.3, CV = BycatchCV),
    InitDepl = x,
    lh.params = parms,
    nyears = nyears,
    obs_CV = 0.2
  )
}
)
med.list <- lapply(
X = InitDepl.vec,
function(x) {
  projections(
    NOut = 50,
    ConstantRateBycatch = list(Rate = 0.02, CV = BycatchCV),
    InitDepl = x,
    lh.params = parms,
    nyears = nyears,
    obs_CV = 0.2
  )
}
)
low.list <- lapply(
X = InitDepl.vec,
function(x) {
  projections(
    NOut = 50,
    ConstantRateBycatch = list(Rate = 0.001, CV = BycatchCV),
    InitDepl = x,
    lh.params = parms,
    nyears = nyears,
    obs_CV = 0.2
  )
}
)
multiplot_proj(
high.d1 = high.list[[1]], # d1 is the lowest depletion
med.d1 = med.list[[1]],
low.d1 = low.list[[1]],
high.d2 = high.list[[2]],
med.d2 = med.list[[2]],
low.d2 = low.list[[2]],
high.d3 = high.list[[3]],
med.d3 = med.list[[3]],
low.d3 = low.list[[3]],
years.to.plot = nyears
)

ktmurray1219/mmrefpoints documentation built on Dec. 21, 2021, 8:40 a.m.