Learn R Programming

glmm.hp (version 0.1-4)

plot.glmmhp: Plot for a glmm.hp object

Description

Plot for a glmm.hp object

Usage

# S3 method for glmmhp
plot(x, plot.perc = FALSE, color = NULL, n = 1, dig = 4, ...)

Value

a ggplot object

Arguments

x

A glmm.hp object.

plot.perc

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

color

Color of variables.

n

Integer; which marginal R2 in output of r.squaredGLMM to plot.

dig

Integer; number of decimal places in Venn diagram.

...

unused

Author

Jiangshan Lai lai@njfu.edu.cn

Examples

Run this code
library(MuMIn)
library(lme4)
mod1 <- lmer(Sepal.Length ~ Petal.Length + Petal.Width +(1 | Species), data = iris)
a <- glmm.hp(mod1)
plot(a)
mod3 <- lm(Sepal.Length ~ Petal.Length+Petal.Width,data = iris)
plot(glmm.hp(mod3,type="R2"))
plot(glmm.hp(mod3,commonality=TRUE),color = c("#8DD3C7", "#FFFFB3"))

Run the code above in your browser using DataLab