-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathplotYieldGear.Rd
More file actions
98 lines (88 loc) · 3.2 KB
/
Copy pathplotYieldGear.Rd
File metadata and controls
98 lines (88 loc) · 3.2 KB
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plots.R
\name{plotYieldGear}
\alias{plotYieldGear}
\alias{plotYieldGear.MizerSim}
\alias{plotlyYieldGear}
\title{Plot the total yield of each species by gear through time}
\usage{
plotYieldGear(object, ...)
\method{plotYieldGear}{MizerSim}(
object,
species = NULL,
gears = NULL,
total = FALSE,
highlight = NULL,
return_data = FALSE,
...
)
plotlyYieldGear(object, species = NULL, total = FALSE, highlight = NULL, ...)
}
\arguments{
\item{object}{An object of class \linkS4class{MizerSim}}
\item{...}{Other arguments (currently unused)}
\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{gears}{A vector of gear names to be included in the plot. Default is
all gears.}
\item{total}{A boolean value that determines whether the total over all
species in the system is plotted as well. Note that even if the plot
only shows a selection of species, the total is including all species.
Default is FALSE.}
\item{highlight}{Name or vector of names of the species to be highlighted.}
\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}
}
\value{
A ggplot2 object, unless \code{return_data = TRUE}, in which case a data
frame with the four variables 'Year', 'Yield', 'Species' and 'Gear' is
returned.
}
\description{
After running a projection, the total yield of each species by fishing gear
can be plotted against time.
}
\details{
This plot is pretty easy to do by hand. It just
gets the biomass using the \code{\link[=getYieldGear]{getYieldGear()}} method and plots using
the ggplot2 package. You can then fiddle about with colours and linetypes
etc. Just look at the source code for details.
}
\examples{
\donttest{
params <- NS_params
sim <- project(params, effort=1, t_max=20, t_save = 0.2, progress_bar = FALSE)
plotYieldGear(sim)
plotYieldGear(sim, species = c("Cod", "Herring"), total = TRUE)
# Returning the data frame
fr <- plotYieldGear(sim, return_data = TRUE)
str(fr)
}
}
\seealso{
\link{plotting_functions}, \code{\link[=getYieldGear]{getYieldGear()}}
Other plotting functions:
\code{\link[=addPlot]{addPlot()}},
\code{\link[=animate.ArrayTimeBySpeciesBySize]{animate.ArrayTimeBySpeciesBySize()}},
\code{\link{plot}},
\code{\link[=plot2]{plot2()}},
\code{\link[=plotBiomass]{plotBiomass()}},
\code{\link[=plotCDF]{plotCDF()}},
\code{\link[=plotCDF2]{plotCDF2()}},
\code{\link[=plotDiet]{plotDiet()}},
\code{\link[=plotFMort]{plotFMort()}},
\code{\link[=plotFeedingLevel]{plotFeedingLevel()}},
\code{\link[=plotGrowthCurves]{plotGrowthCurves()}},
\code{\link{plotMizerParams}},
\code{\link{plotMizerSim}},
\code{\link[=plotPredMort]{plotPredMort()}},
\code{\link[=plotRelative]{plotRelative()}},
\code{\link[=plotSpectra]{plotSpectra()}},
\code{\link[=plotSpectra2]{plotSpectra2()}},
\code{\link[=plotSpectraRelative]{plotSpectraRelative()}},
\code{\link[=plotYield]{plotYield()}},
\code{\link{plotting_functions}}
}
\concept{plotting functions}