barplot_hp {UpSetVP}R Documentation

Visualization of HP Using Column Diagram

Description

Visualization of individual effects in hierarchical partitioning (HP) using column diagram.

Usage

barplot_hp(
  x,
  order.var = TRUE,
  decreasing.var = TRUE,
  cutoff = -1,
  col.fill = "valid",
  col.color = NULL,
  col.width = 0.6,
  show.effect = TRUE,
  effect.cex = 2.7,
  title.cex = 10,
  axis.cex = 8
)

Arguments

x

A rdacca.hp object, which contains the output of HP from canonical analysis.

order.var

The predictors in the matrix layout should be ordered by. Default is TRUE, which orders the predictors by their effect values. IF FALSE, sort by the order of predictors in input data.

decreasing.var

If order.var=TRUE, how the predictors should be ordered. Default is TRUE, from greatest to least.

cutoff

Effect values below cutoff will not be displayed, default is -1. Note: Negative values due to adjustment of R-squared mean negligible contributions, but they are included in the computation of the total contribution of each predictor category.

col.fill

How the bars should be colored. Options include "valid" (according to the validity of effects) or "vars" (color by predictors), default is "valid".

col.color

Color of bars.

col.width

Width of bars, default is 0.6.

show.effect

Show the effect values above bars, default is TRUE.

effect.cex

Font size of the effect values, default is 2.7.

title.cex

Font size of axis titles, default is 10.

axis.cex

Font size of axis labels, default is 8.

Details

This function is used to visualize the object of rdacca.hp (Lai et al. 2022), which calculates the individual effects of predictor variables or groups of predictor variables in canonical analysis based on HP.

Value

Returns a ggplot2.

References

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.

Examples


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")

# Quantify the individual effects of soil properties on EcM fungal community composition
soil <- baima.env[c("pH", "TP", "TK", "AN", "AP", "AK")]
baima.soil.vp <- rdacca.hp(baima.fun.bray, soil, method = "dbRDA", type = "adjR2")

# Plot individual effects
barplot_hp(baima.soil.vp, col.fill = "var", 
 col.color = c("#8DD3C7", "#FFFFB3", "#BEBADA", "#FB8072", "#80B1D3", "#FDB462", "#B3DE69"))


[Package UpSetVP version 1.0.0 Index]