plot.phyloglmhp: Plot for a 'phyloglm.hp' object

View source: R/plot.phylolmhp.r

plot.phyloglmhpR Documentation

Plot for a phyloglm.hp object

Description

Plot for a phyloglm.hp object

Usage

## S3 method for class 'phyloglmhp'
plot(x, plot.perc = FALSE, commonality = FALSE, color = NULL, dig = 4, ...)

Arguments

x

A phyloglm.hp object.

plot.perc

Logical;if TRUE, the bar plot (based on ggplot2 package) of the percentage to individual effects of variables and phylogenetic signal towards total explained variation, the default is FALSE to show plot with original individual effects.

commonality

Logical; If TRUE, the result of commonality analysis is shown, the default is FALSE.

color

Color of variables.

dig

Integer; number of decimal places in Venn diagram.

...

unused

Value

a ggplot object

Author(s)

Jiangshan Lai lai@njfu.edu.cn

Examples

library(phylolm)
library(rr2)
set.seed(123456)
tre <- rtree(50)
x1 <- rTrait(n=1, phy=tre)  
x2 <- rTrait(n=1, phy=tre)
X <- cbind(rep(1, 50), x1, x2)
y <- rbinTrait(n=1, phy=tre, beta=c(-1, 0.8, 0.9), alpha=1, X=X)
dat <- data.frame(trait01=y, predictor1=x1, predictor2=x2)
fit <- phyloglm(trait01 ~ predictor1 + predictor2, phy=tre, data=dat)
plot(phyloglm.hp(fit,commonality=TRUE))
plot(phyloglm.hp(fit,commonality=TRUE),commonality=TRUE)

phylolm.hp documentation built on April 4, 2025, 5:12 a.m.