| PTMN_plot | R Documentation |
This function creates visualizations of plant trait multilayer networks (PTMNs) constructed using the PTMN framework. PTMNs systematically integrate multilayer network theory with plant functional trait analysis, enabling quantitative assessments of trait relationships across plant organs and functional systems.
PTMN_plot(
data,
style = 1,
vertex.size = 15,
show.labels = TRUE,
vertex.label.cex = 0.7,
vertex.label.dist = 0.2,
edge.width = 2,
vertex.label.font = 2,
node.alpha = 1,
module.alpha = 0.3,
show.legend = TRUE,
legend.pos = "bottomright",
legend.cex = 1,
legend.pt.size = 2.5,
x.intersp = 2,
y.intersp = 2,
title.font = 2,
title.cex = 1.2
)
data |
A data frame containing the PTMN edge list with columns: node.from, node.to, layer.from, layer.to.
This should be the output from the |
style |
Integer specifying the layout style. Options are:
|
vertex.size |
Numeric value controlling the size of network nodes (vertices). Default is 15. |
show.labels |
Logical indicating whether to display node labels. Default is TRUE. |
vertex.label.cex |
Numeric value controlling the size of vertex labels. Default is 0.7. |
vertex.label.dist |
Numeric value controlling the distance of labels from vertices. Default is 0.2. |
edge.width |
Numeric value controlling the width of network edges. Default is 2. |
vertex.label.font |
Integer specifying the font style for vertex labels (1=plain, 2=bold, 3=italic, 4=bold italic). Default is 2. |
node.alpha |
Numeric value between 0 and 1 controlling the transparency of nodes. Default is 1 (opaque). |
module.alpha |
Numeric value between 0 and 1 controlling the transparency of module highlighting. Default is 0.3. |
show.legend |
Logical indicating whether to display the layer legend. Default is TRUE. |
legend.pos |
Character string specifying legend position. Options include "bottomright", "bottomleft", "topright", "topleft". Default is "bottomright". |
legend.cex |
Numeric value controlling the size of legend text. Default is 1. |
legend.pt.size |
Numeric value controlling the size of legend symbols. Default is 2.5. |
x.intersp |
Numeric value controlling horizontal spacing in legend. Default is 2. |
y.intersp |
Numeric value controlling vertical spacing in legend. Default is 2. |
title.font |
Integer specifying the font style for legend title. Default is 2 (bold). |
title.cex |
Numeric value controlling the size of legend title. Default is 1.2. |
The PTMN visualization distinguishes between intralayer edges (black lines) showing relationships between traits within the same organ or functional system, and interlayer edges (red lines) representing interactions between traits in different layers. Each layer corresponds to specific functional or structural units such as individual plant organs (leaves, stems, roots) or functional systems.
In style 1, cross-layer modules are highlighted with shaded areas, representing tightly connected functional groups that span multiple layers. In style 2, the circular layout arranges nodes by layer in a circular pattern, making layer organization more visually apparent.
Node colors are automatically assigned based on layer membership using the "ggsci::nrc_npg" color palette, ensuring visual distinction between different functional layers.
No return value. This function is called for its side effect of creating a network plot.
PTMN for constructing plant trait multilayer networks
## Not run:
data(forest_invader_tree)
data(forest_invader_traits)
traits <- forest_invader_traits[, 6:73]
layers <- list(
shoot_dynamics = c("LeafDuration", "LeafFall50", "LeafRate_max",
"Chl_shade50", "LAgain", "FallDuration",
"LeafOut", "Chl_sun50", "EmergeDuration",
"LeafTurnover"),
leaf_structure = c("PA_leaf", "Mass_leaf", "Lifespan_leaf",
"Thick_leaf", "SLA", "Lobe", "LDMC",
"Stomate_size", "Stomate_index"),
leaf_metabolism = c("J_max", "Vc_max", "Asat_area", "CC_mass",
"LSP", "AQY", "CC_area", "Rd_area",
"Asat_mass", "WUE", "Rd_mass", "PNUE"),
leaf_chemistry = c("N_area", "Chl_area", "DNA", "Phenolics",
"Cellulose", "N_mass", "N_litter", "Chl_ab",
"Chl_mass", "N_res", "C_litter", "C_area",
"C_mass", "Ash", "Lignin", "Solubles",
"Decomp_leaf", "Hemi"),
root = c("NPP_root", "SS_root", "SRL", "RTD", "RDMC",
"NSC_root", "Decomp_root", "Starch_root",
"C_root", "N_root", "Lignin_root"),
stem = c("Latewood_diam", "Metaxylem_diam", "Earlywood_diam",
"NSC_stem", "Vessel_freq", "SS_stem", "Cond_stem",
"Starch_stem")
)
graph <- PTMN(traits, layers_list = layers, method = "pearson")
PTMN_plot(graph, style = 1, vertex.size = 8,
vertex.label.cex = 0.5, edge.width = 2,
show.legend = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.