PlotNPS | R Documentation |
High-level functions for plotting node properties.
PlotNPS(community, X, Y, main = CPS(community)$title, xlab, ylab, xlim = NULL, ylim = NULL, colour.by, colour.spec, col = NULL, symbol.by, symbol.spec, pch = NULL, bg.by, bg.spec, bg = NULL, cex.by = NULL, cex.spec = NULL, cex = NULL, label.colour.by = NULL, label.colour.spec = NULL, label.colour = NULL, link.colour.by = NULL, link.colour.spec = NULL, link.col = NULL, link.line.type.by = NULL, link.line.type.spec = NULL, link.lty = NULL, link.lwd = NULL, highlight.links = NULL, highlight.nodes = Cannibals, lowlight.nodes, show.na = FALSE, show.web = TRUE, show.nodes.as = "points", node.labels = NULL, label.cex = 0.6, are.values = FALSE, frame.plot = TRUE, ...) PlotMvN(community, xlab = Log10NLabel(community), ylab = Log10MLabel(community), ...) PlotNvM(community, xlab = Log10MLabel(community), ylab = Log10NLabel(community), ...) PlotBvM(community, xlab = Log10MLabel(community), ylab = Log10BLabel(community), ...) PlotMvB(community, xlab = Log10BLabel(community), ylab = Log10MLabel(community), ...)
community |
an object of class |
X |
the name of a property that is plotted on the x axis. Must meet the
criteria of the |
Y |
plotted on the y axis; see |
xlab |
title of the x axis. |
ylab |
title of the y axis. |
main |
title of the plot. |
xlim |
limits of the x axis. |
ylim |
limits of the y axis. |
colour.by |
node colours property. Either |
colour.spec |
node colours specification. Either |
col |
node colours. |
symbol.by |
node symbols property; must meet the criteria of
|
symbol.spec |
node symbols specification. |
pch |
node symbols. |
bg.by |
node background colours property; must meet the criteria of
|
bg.spec |
node background colours specification; must meet the
criteria of |
bg |
node background colours. |
cex.by |
node cex values property; must meet the criteria of
|
cex.spec |
node cex values specification; must meet the
criteria of |
cex |
node cex values. |
label.colour.by |
node label colours property; must meet the criteria
of |
label.colour.spec |
node label colours specification; must meet the
criteria of |
label.colour |
node label colours. |
link.colour.by |
link colours; either |
link.colour.spec |
link line colour specification; either
|
link.col |
link colours. |
link.line.type.by |
link link types; must meet the criteria of
|
link.line.type.spec |
link line type specification; must meet the
criteria of |
link.lty |
link line types. |
link.lwd |
line line widths. |
highlight.links |
either |
highlight.nodes |
nodes to be highlighted; either |
lowlight.nodes |
nodes to be lowlighted; must meet the criteria of
|
show.na |
logical - if |
show.web |
logical - if |
show.nodes.as |
how nodes should be plotted. One of
|
node.labels |
Either |
label.cex |
a character expansion factor; used only if
|
are.values |
logical - if |
frame.plot |
logical - default |
... |
other values to plot functions. |
The general-purpose function PlotNPS
plots one
node property against another.
For colour.by
, symbol.by
, bg.by
, cex.by
and
label.colour.by
, if X.by
is not NULL
and a relevant
X.spec
is not given, the X.by
values are converted to a
factor
, the levels of which are used as the plot parameter.
An error is raised if X.by
contains any values not present in
X.spec
.
If colour.by
/bg.by
/symbol.by
is NULL
and
community
has a node property named ‘category’ then node
colours/background colours/symbols are given by ‘category’ using the
colour.spec
/bg.spec
/symbol.spec
given by
DefaultCategoryColours
/DefaultCategorySymbols
.
label.colour.by
, node.labels
and label.cex
are used only
if show.nodes.as
is equal to "points".
The convenience functions PlotMvN
, PlotNvM
, PlotBvM
and
PlotMvB
are ‘wrappers’ around PlotNPS
that plot
log10-transformed body mass (M), numerical abundance (N) or biomass (B).
All of the parameters of PlotNPS
, with the exception of
X
, Y
and are.values
, can be used with these four
functions.
If show.nodes.as
is equal to "points" then labels are plotted using
label.cex
and label.colour
.
Lawrence Hudson
Community
,
NPS
,
DefaultCategoryColours
,
DefaultCategorySymbols
,
PlotBSpectrum
,
PlotCircularWeb
,
PlotNPSDistribution
,
PlotNSpectrum
,
PlotRankNPS
,
PlotTLPS
,
PlotWebByLevel
PlaceMissingPoints
data(TL84) PlotNvM(TL84) # Set colours and plot symbols directly PlotNvM(TL84, col=1, pch=19, highlight.nodes=NULL) # Plot each level of taxonomic resolution in a different colour PlotNvM(TL84, colour.by='resolved.to', pch=19, highlight.nodes=NULL) # Plot each level of taxonomic resolution in a specific colour colour.spec <- c(Species='purple3', Genus='green3', 'red3') PlotNvM(TL84, colour.by='resolved.to', colour.spec=colour.spec, pch=19, highlight.nodes=NULL) legend("topright", legend=names(colour.spec), pch=19, col=colour.spec) # Use PlotNPS to plot trophic height against log10 body mass PlotNPS(TL84, 'Log10M', 'TrophicHeight', xlab=Log10MLabel(TL84), ylab='Trophic height') # The 'POM (detritus)' node in the Ythan Estuary dataset lacks both body mass # and numerical abundance. par(mfrow=c(1,2)) data(YthanEstuary) PlotNvM(YthanEstuary) PlotNvM(YthanEstuary, show.na=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.