
Visualize multi-orientation environmental–species correlation heatmaps
Source:R/gglink_heatmaps.R
gglink_heatmaps.RdVisualize multi-orientation environmental–species correlation heatmaps
Usage
gglink_heatmaps(
env,
spec,
env_select = NULL,
spec_select = NULL,
spec_layout = "circle_outline",
spec_orientation = c("up", "down", "left", "right"),
spec_relation = TRUE,
relation_method = c("correlation", "mantel"),
cor.method = c("pearson", "kendall", "spearman"),
cor.use = c("everything", "all", "complete", "pairwise", "na"),
mantel.method = c("mantel", "mantel.partial", "mantelhaen.test", "mantel.correlog"),
mantel.method2 = c("pearson", "kendall", "spearman"),
mantel.alternative = c("two.sided", "less", "greater"),
drop_nonsig = FALSE,
shape = 22,
distance = 3,
fontsize = 5,
orientation = c("top_right", "bottom_right", "top_left", "bottom_left"),
r = 6
)Arguments
- env
Data Frame A data frame or matrix containing environmental variables. Each column represents an environmental factor.
- spec
Data Frame A data frame or matrix containing species abundance or trait data. Each column represents a species or taxonomic unit.
- env_select
Optional list specifying the column indices (or names) of environmental variables to include in each environmental block. Each list element corresponds to one quadrant of the heatmap layout.
- spec_select
Optional list specifying column indices (or names) of species to include. If multiple elements are provided, they define separate species clusters in the visualization.
- spec_layout
Character Character string specifying the spatial arrangement of species nodes. Options include `"ringle"` (radial) and other supported layouts.
- spec_orientation
Character spec_oritation. Options include: "up","down","left","right"
- spec_relation
Logical (defalt = TRUE) Whether to compulate the ralationship of spec
- relation_method
Character Method for computing relationships between species and environmental factors. Options are `"correlation"` or `"mantel"`.
- cor.method
Character Correlation method to use when `relation_method = "correlation"`. One of `"pearson"`, `"kendall"`, or `"spearman"`.
- cor.use
Character Method for handling missing values in correlation computation. One of `"everything"`, `"all"`, `"complete"`, `"pairwise"`, or `"na"`.
- mantel.method
Character Type of Mantel test to use when `relation_method = "mantel"`. Options include `"mantel"`, `"mantel.partial"`, `"mantelhaen.test"`, and `"mantel.correlog"`.
- mantel.method2
Character Correlation coefficient used in the Mantel test. One of `"pearson"`, `"kendall"`, or `"spearman"`.
- mantel.alternative
Character Alternative hypothesis for Mantel test. One of `"two.sided"`, `"less"`, or `"greater"`.
- drop_nonsig
Logical if `TRUE`, non-significant correlations are dropped from the final visualization.
- shape
Intrger Integer or numeric specifying the shape of species nodes in the plot (passed to `geom_point()`).
- distance
Numeric the offset distance between central nodes and the environmental heatmaps.
- fontsize
Numeric (default = 5) The fontsize in env heatmap
- orientation
Character Character vector defining which heatmap quadrants to display. Can include any combination of `"top_right"`, `"bottom_right"`, `"top_left"`, and `"bottom_left"`.
- r
Numeric radius of the central species layout (in plot units).