Learn R Programming

phylolm.hp (version 0.0-4)

plot.phyloglmhp: Plot for a phyloglm.hp object

Description

Plot for a phyloglm.hp object

Usage

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

Value

a ggplot object

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

Author

Jiangshan Lai lai@njfu.edu.cn

Examples

Run this code
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)

Run the code above in your browser using DataLab