View source: R/plot.phylolmhp.r
plot.phyloglmhp | R Documentation |
phyloglm.hp
objectPlot for a phyloglm.hp
object
## S3 method for class 'phyloglmhp'
plot(x, plot.perc = FALSE, commonality = FALSE, color = NULL, dig = 4, ...)
x |
A |
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 |
a ggplot object
Jiangshan Lai lai@njfu.edu.cn
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.