plot.osmose | R Documentation |
This method takes a osmose
object and produce useful
plots
This function implements a plot method for different osmose classes.
## S3 method for class 'osmose' plot(x, what = "biomass", ...) ## S3 method for class 'osmose.biomass' plot( x, ts = TRUE, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, initialYear = NULL, replicates = TRUE, freq = 12, horizontal = FALSE, conf = 0.95, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, alpha = NULL, border = NULL, lty = 1, lwd = 1, axes = TRUE, legend = TRUE, units = "tonnes", zero = FALSE, ... ) ## S3 method for class 'osmose.abundance' plot( x, species = NULL, speciesNames = NULL, start = NULL, end = NULL, initialYear = NULL, ts = TRUE, type = 1, replicates = TRUE, freq = 12, horizontal = FALSE, conf = 0.95, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, alpha = NULL, border = NULL, lty = 1, lwd = 1, axes = TRUE, legend = TRUE, units = "individuals", ... ) ## S3 method for class 'osmose.yield' plot( x, species = NULL, speciesNames = NULL, start = NULL, end = NULL, initialYear = NULL, ts = TRUE, type = 1, replicates = TRUE, freq = 12, horizontal = FALSE, conf = 0.95, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, alpha = NULL, border = NULL, lty = 1, lwd = 1, axes = TRUE, legend = TRUE, units = "tonnes", ... ) ## S3 method for class 'osmose.yieldN' plot( x, species = NULL, speciesNames = NULL, start = NULL, end = NULL, initialYear = NULL, ts = TRUE, type = 1, replicates = TRUE, freq = 12, horizontal = FALSE, conf = 0.95, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, alpha = NULL, border = NULL, lty = 1, lwd = 1, axes = TRUE, legend = TRUE, units = "individuals", ... ) ## S3 method for class 'osmose.biomassByTL' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "", y = "tonnes"), ... ) ## S3 method for class 'osmose.biomassBySize' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "cm", y = "tonnes"), ... ) ## S3 method for class 'osmose.biomassByAge' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "years", y = "tonnes"), ... ) ## S3 method for class 'osmose.abundanceByTL' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "", y = "individuals"), ... ) ## S3 method for class 'osmose.abundanceBySize' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "cm", y = "individuals"), ... ) ## S3 method for class 'osmose.abundanceByAge' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "years", y = "individuals"), ... ) ## S3 method for class 'osmose.yieldNBySize' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "cm", y = "individuals"), ... ) ## S3 method for class 'osmose.yieldNByAge' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "years", y = "individuals"), ... ) ## S3 method for class 'osmose.yieldBySize' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "cm", y = "tonnes"), ... ) ## S3 method for class 'osmose.yieldByAge' plot( x, type = 1, species = NULL, speciesNames = NULL, start = NULL, end = NULL, freq = 12, horizontal = FALSE, factor = 0.001, xlim = NULL, ylim = NULL, col = NULL, border = NULL, legend = TRUE, lty = 1, lwd = 1, axes = TRUE, units = list(x = "years", y = "tonnes"), ... )
x |
|
what |
Variable name to plot. By default is |
... |
Extra arguments of the function. See Details. |
ts |
|
type |
A |
species |
A |
speciesNames |
A vector with the names for each species. If |
start |
A |
end |
A |
initialYear |
A |
replicates |
|
freq |
A |
horizontal |
a |
conf |
|
factor |
A number to indicate the scale of the variable on the y-axis.
By default |
xlim, ylim |
numeric vectors of length 2, giving the x and y coordinates ranges. |
col |
A vector with the color names for the plots. By default
|
alpha |
factor modifying the opacity alpha given to confidence interval
(CI) polygons (check |
border |
the color to draw the border of CI polygons, bar plots and
box plots. The default value ( |
lty |
The line type (check |
lwd |
The line width (check |
axes |
a |
legend |
|
units |
String with units of the variable that defines the label set
on top of the plot. If |
what
argument can take next values:
"biomass" to plot the species biomass (see plot.osmose.biomass)
"abundance" to plot the species abundance (see plot.osmose.abundance)
"yield" to plot the species yield (see plot.osmose.yield)
"yieldN" to plot the species yield (in numbers) (see plot.osmose.yieldN)
User can select within different plot types depending on the osmose
class. So, for classes biomass
, abundance
, yield
and
yieldN
(Group 1) the user must use ts
and type
arguments to specify the type of plot to draw.
So, for the Group 1 and ts = TRUE
, user will select within:
type = 1
: Generates a matrix plot of the selected variable
plotted independently.
type = 2
: Generates a single plot with overlaped time series.
You can include confidence interval shadow around lines.
type = 3
: Generates a single plot with cumulated time series.
So, the method will sort and overlap the time series values for the selected
variable
type = 4
: ONLY valid for a single species. It generates a bar
plot of the time series.
For the Group 1 and ts = FALSE
, user will select within:
type = 1
: Generates a bar plot of the selected variable by
species, including interval confidence bars.
type = 2
: Generates a boxplot of the selected variable by
species.
The Group 2 refers classes of Group 1 with By
specification (e.g. yieldNBySize
, abundanceByAge
,
biomassByTL
). There are 2 available plot types:
type = 1
: Generates a bar plot of the selected variable by
species. The ...
will be passed to the internal barplot
function.
type = 2
: Generates a plot using image.plot function,
placing the species in the left axis, the By-variable (e.g. Size) on the
bottom and the main variable (e.g. biomass) in a color scale. The ...
will be passed to the internal image.plot function.
Both alpha
and border
controls the opacity and the color of
border, respectively, for polygons, bar plots and box plots. So depending on
the ts
-type
, they will have different default values:
alpha = 0.3
& border = NA
for TS = TRUE
with
type = 1 or 2
.
alpha = 1
& border = TRUE
for Everything else.
species
argument follows the indexation way of java: starting in zero,
as osmose-java returns species outputs.
Default value for freq
will be calculated from x
:
freq = 1/x$model$start.
units
could be whether a single character vector (currently applied on
classes without By, e.g. osmose.biomass
,
osmose.yieldN
) or a list of length 2 specifying the units for x and y
(currently used with classes with By, e.g.
plot.osmose.biomassBySize
, plot.osmose.yieldNByAge
).
Extra arguments can be passed from plot.default using ...
:
cex
, cex.axis
, border
(useful for polygon,
boxplots and barplots), etc. It is important to notice that,
depending on where the ellipsys is passed, it allows and refuse the use of
certain arguments. For instance, if the selected plot is a bar plot, the
...
will be passed to the internal barplot
call, so if
cex
argument is used, it will create a conflict and an error (a
typical error of using cex
in barplot function).
A graph of an osmose
object.
Criscely Lujan Paredes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.