-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathplotFeedingLevel.Rd
108 lines (97 loc) · 3.55 KB
/
plotFeedingLevel.Rd
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plots.R
\name{plotFeedingLevel}
\alias{plotFeedingLevel}
\alias{plotlyFeedingLevel}
\title{Plot the feeding level of species by size}
\usage{
plotFeedingLevel(
object,
species = NULL,
time_range,
highlight = NULL,
all.sizes = FALSE,
include_critical = FALSE,
return_data = FALSE,
...
)
plotlyFeedingLevel(
object,
species = NULL,
time_range,
highlight = NULL,
include_critical,
...
)
}
\arguments{
\item{object}{An object of class \linkS4class{MizerSim} or
\linkS4class{MizerParams}.}
\item{species}{The species to be selected. Optional. By default all target
species are selected. A vector of species names, or a
numeric vector with the species indices, or a logical vector indicating for
each species whether it is to be selected (TRUE) or not.}
\item{time_range}{The time range (either a vector of values, a vector of min
and max time, or a single value) to average the abundances over. Default is
the final time step. Ignored when called with a \linkS4class{MizerParams}
object.}
\item{highlight}{Name or vector of names of the species to be highlighted.}
\item{all.sizes}{If TRUE, then feeding level is plotted also for sizes
outside a species' size range. Default FALSE.}
\item{include_critical}{If TRUE, then the critical feeding level is also
plotted. Default FALSE.}
\item{return_data}{A boolean value that determines whether the formatted data
used for the plot is returned instead of the plot itself. Default value is FALSE}
\item{...}{Other arguments (currently unused)}
}
\value{
A ggplot2 object, unless \code{return_data = TRUE}, in which case a data
frame with the variables 'w', 'value' and 'Species' is returned. If also
\code{include_critical = TRUE} then the data frame contains a fourth variable
'Type' that distinguishes between 'actual' and 'critical' feeding level.
}
\description{
After running a projection, plot the feeding level of each species by size.
The feeding level is averaged over the specified time range (a single value
for the time range can be used).
}
\details{
When called with a \linkS4class{MizerSim} object, the feeding level is averaged
over the specified time range (a single value for the time range can be used
to plot a single time step). When called with a \linkS4class{MizerParams}
object the initial feeding level is plotted.
If \code{include_critical = TRUE} then the critical feeding level (the feeding
level at which the intake just covers the metabolic cost) is also plotted,
with a thinner line. This line should always stay below the line of the
actual feeding level, because the species would stop growing at any point
where the feeding level drops to the critical feeding level.
}
\examples{
\donttest{
params <- NS_params
sim <- project(params, effort=1, t_max=20, t_save = 2, progress_bar = FALSE)
plotFeedingLevel(sim)
plotFeedingLevel(sim, time_range = 10:20, species = c("Cod", "Herring"),
include_critical = TRUE)
# Returning the data frame
fr <- plotFeedingLevel(sim, return_data = TRUE)
str(fr)
}
}
\seealso{
\link{plotting_functions}, \code{\link[=getFeedingLevel]{getFeedingLevel()}}
Other plotting functions:
\code{\link{animateSpectra}()},
\code{\link{plot,MizerParams,missing-method}},
\code{\link{plot,MizerSim,missing-method}},
\code{\link{plotBiomass}()},
\code{\link{plotDiet}()},
\code{\link{plotFMort}()},
\code{\link{plotGrowthCurves}()},
\code{\link{plotPredMort}()},
\code{\link{plotSpectra}()},
\code{\link{plotYield}()},
\code{\link{plotYieldGear}()},
\code{\link{plotting_functions}}
}
\concept{plotting functions}