plot.funspace {funspace} | R Documentation |
Functional space plotting
Description
Takes a funspace
object produced by funspace()
or funspaceGAM()
and plots the trait probability distribution (TPD) or the map of the response variable (depending of which kind of funspace object is provided) in a functional space.
Usage
## S3 method for class 'funspace'
plot(
x = NULL,
type = "global",
which.group = NULL,
quant.plot = FALSE,
quant = NULL,
quant.lty = 1,
quant.col = "grey30",
quant.lwd = 1,
quant.labels = TRUE,
colors = NULL,
ncolors = 100,
pnt = FALSE,
pnt.pch = 19,
pnt.cex = 0.5,
pnt.col = "grey80",
arrows = FALSE,
arrows.length = 1,
arrows.head = 0.08,
arrows.col = "black",
arrows.label.col = "black",
arrows.label.pos = 1.1,
arrows.label.cex = 1,
axis.title = TRUE,
axis.title.x = NULL,
axis.title.y = NULL,
axis.title.cex = 1,
axis.title.line = 2,
axis.cex = 1,
globalContour = TRUE,
globalContour.quant = NULL,
globalContour.lwd = 3,
globalContour.lty = 1,
globalContour.col = "grey50",
xlim = NULL,
ylim = NULL,
...
)
Arguments
x |
A |
type |
character indicating whether the plots should represent the global distribution of observations ( |
which.group |
when plotting groups, either a character or a number indicating the name (character) or position (number) of a single group to be plotted individually. |
quant.plot |
Logical, Default is |
quant |
A vector specifying the quantiles to be plotted (in case |
quant.lty |
type of line to be used to represent quantiles. See |
quant.col |
Color to be used in the quantile lines. Defaults to |
quant.lwd |
Line width to be used in the quantile lines. Defaults to 1. |
quant.labels |
Logical, Default is |
colors |
A vector defining the colors of plotted quantiles in the TPD case. Only two colors need to be specified. The first color is automatically assigned to the highest quantile in |
ncolors |
number of colors to include in the color gradients set by |
pnt |
Logical, defaults to |
pnt.pch |
Numerical. Graphical parameter to select the type of point to be drawn. Default is set to 19. See |
pnt.cex |
Numerical. Graphical parameter to set the size of the points. Default is 0.5. See |
pnt.col |
Graphical parameter to set the points color. Default is |
arrows |
Logical, defaults to |
arrows.length |
Numerical. Graphical parameter to set the length of the arrow (see |
arrows.head |
Numerical. Graphical parameter to set the length of the arrow head (see |
arrows.col |
Graphical parameter to set the arrows color (see |
arrows.label.col |
Graphical parameter to set the color of the arrows labels color. Default is |
arrows.label.pos |
Numerical. Graphical parameter to set the position of the arrow labels with respect to the arrow heads. Default is 1.1, which draws arrow labels slightly beyond the arrow heads. A value of 1 means drawing labels on top of arrow heads. |
arrows.label.cex |
Numerical. Graphical parameter to set the size of arrow labels. Defaults to 1. |
axis.title |
Logical. Default is |
axis.title.x |
Character. The title to be plotted in the x axis if |
axis.title.y |
Character. The title to be plotted in the y axis if |
axis.title.cex |
Numerical. Graphical parameter to set the size of the axes titles. Default is 1. |
axis.title.line |
Numerical. Graphical parameter to set the on which margin line to plot axes titles. Default is 2. |
axis.cex |
Numerical. Graphical parameter to set the size of the axes annotation. Default is 1. |
globalContour |
Logical, Default is |
globalContour.quant |
A vector specifying the quantiles to be plotted (in case |
globalContour.lwd |
Line width to be used in the global contour lines. Defaults to 3. |
globalContour.lty |
type of line to be used to represent the global contour lines. See |
globalContour.col |
Graphical parameter to set the color of the global contour lines. Default is |
xlim |
the x limits (x1, x2) of the plot. |
ylim |
the y limits (y1, y2) of the plot. |
... |
Other arguments |
Details
Produces default plots. If the input object was generated with funspace()
, the plot shows a bivariate functional trait space displaying trait probability densities (for single or multiple groups). If the input object was generated with funspaceGAM
, the plot shows a heatmap depicting how a target variable is distributed within the functional trait space (for single or multiple groups).
Value
No return value. This function is called for its side effect: generating plots.
Examples
x <- princomp(GSPFF)
funtest <- funspace(x = x, PCs = c(1, 2), threshold = 0.95)
plot(funtest, type = "global", quant.plot = TRUE, quant.lwd = 2, pnt = TRUE, pnt.cex = 0.1,
pnt.col = rgb(0.1, 0.8, 0.2, alpha = 0.2), arrows = TRUE, arrows.length = 0.7)