upset_vp | R Documentation |
Visualization of variance partitioning analysis (VPA) and hierarchical partitioning (HP) with unlimited number of predictor variables (or matrices of predictors) using UpSet matrix layout.
upset_vp( x, plot.hp = TRUE, order.part = "effect", decreasing.part = TRUE, order.var = TRUE, decreasing.var = TRUE, cutoff = -1, nVar = 30, col.width = 0.6, pch.size = 3, line.lwd = 0.5, show.effect = TRUE, effect.cex = 2.7, title.cex = 10, axis.cex = 8, height.ratio = c(2, 1), width.ratio = c(1, 3) )
x |
A |
plot.hp |
The default is |
order.part |
How the VPA components in matrix layout should be ordered. Options include |
decreasing.part |
How the intersections in |
order.var |
The predictors in the matrix layout should be ordered by. Default is |
decreasing.var |
If |
cutoff |
Effects below |
nVar |
Number of components in VPA to plot, default is |
col.width |
Width of bars in column diagram, default is |
pch.size |
Size of points in matrix diagram, default is |
line.lwd |
Width of lines in matrix diagram, default is |
show.effect |
Show the relative importance of predictors (unique, common, or individual effects) above bars, default is |
effect.cex |
Font size of the effects, default is |
title.cex |
Font size of axis titles, default is |
axis.cex |
Font size of axis labels, default is |
height.ratio |
Ratio between matrix and top column diagram, default is |
width.ratio |
Ratio between matrix and left column diagram, default is |
UpSetVP diagram is an extension of UpSet technique (Conway et al. 2017; Lex et al. 2014) to canonical analysis and is used to visualize the object of rdacca.hp
(Lai et al. 2022). The matrix layout enables the effective representation of relative importance of predictors, such as the unique effects and common effects in VPA, as well as additional summary statistics or individual effects in HP. UpSetVP diagram could, in principle, allow visualization of any number of predictor variables or groups of predictor variables. But considering the interpretability of data, we would like to recommend that the number of predictors (or groups of predictors) no more than 7.
Returns a ggplot2.
Conway J R, Lex A, Gehlenborg N. UpSetR: an R package for the visualization of intersecting sets and their properties. Bioinformatics, 2017, 33(18): 2938-2940.
Gong S, Feng B, Jian S P, et al. Elevation Matters More than Season in Shaping the Heterogeneity of Soil and Root Associated Ectomycorrhizal Fungal Community. Microbiology spectrum, 2022, 10(1): e01950-21.
Lai J, Zou Y, Zhang J, et al. Generalizing hierarchical and variation partitioning in multiple regression and canonical analyses using the rdacca.hp R package. Methods in Ecology and Evolution, 2022.
Lex A, Gehlenborg N, Strobelt H, et al. UpSet: visualization of intersecting sets. IEEE transactions on visualization and computer graphics, 2014, 20(12): 1983-1992.
library(rdacca.hp) ## A simple example of partial dbRDA data(baima.fun) data(baima.env) # Bray-Curtis index was used to calculate community composition dissimilarity baima.fun.bray <- vegdist(baima.fun, method = "bray") # The relative importance of individual soil properties on EcM fungal community compositionon soil <- baima.env[c("pH", "TP", "TK", "AN", "AP", "AK")] baima.soil.vp <- rdacca.hp(baima.fun.bray, soil, method = "dbRDA", var.part = TRUE, type = "adjR2") # Plot unique, common, as well as individual effects upset_vp(baima.soil.vp, plot.hp = TRUE) ## Example was referenced from Gong et al. (2022) if(requireNamespace("adespatial", quietly = TRUE)) { # Distance-based Moran's eigenvector maps (dbMEM) was used to extract spatial relationships space.dbmem <- adespatial::dbmem(baima.env[c("latitude", "lontitude")]) # The relative importance of groups of environmental factors on EcM fungal community composition env.list <- list( elevation = baima.env["altitude"], season = baima.env["season"], space = data.frame(space.dbmem)[1:2], host = baima.env[c("em.GR", "em.abun")], climate = baima.env["sea.MT"], soil = baima.env[c("pH", "TP", "TK", "AN", "AP", "AK")] ) baima.env.vp <- rdacca.hp(baima.fun.bray, env.list, method = "dbRDA", var.part = TRUE, type = "adjR2") # Plot unique, common, as well as individual effects upset_vp(baima.env.vp, plot.hp = TRUE, order.part = "degree") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.