Learn R Programming

ggfortify (version 0.4.17)

autoplot.lm: Autoplot stats::lm and stats::glm

Description

Autoplot stats::lm and stats::glm

Usage

# S3 method for lm
autoplot(
  object,
  which = c(1:3, 5),
  data = NULL,
  colour = "#444444",
  size = NULL,
  linetype = NULL,
  alpha = NULL,
  fill = NULL,
  shape = NULL,
  label = TRUE,
  label.label = ".label",
  label.colour = "#000000",
  label.alpha = NULL,
  label.size = NULL,
  label.angle = NULL,
  label.family = NULL,
  label.fontface = NULL,
  label.lineheight = NULL,
  label.hjust = NULL,
  label.vjust = NULL,
  label.repel = FALSE,
  label.n = 3,
  smooth.colour = "#0000FF",
  smooth.linetype = "solid",
  ad.colour = "#888888",
  ad.linetype = "dashed",
  ad.size = 0.2,
  nrow = NULL,
  ncol = NULL,
  ...
)

Value

ggplot

Arguments

object

stats::lm instance

which

If a subset of the plots is required, specify a subset of the numbers 1:6.

data

original dataset, if needed

colour

line colour

size

point size

linetype

line type

alpha

alpha

fill

fill colour

shape

point shape

label

Logical value whether to display labels

label.label

Column name used for label text

label.colour

Colour for text labels

label.alpha

Alpha for text labels

label.size

Size for text labels

label.angle

Angle for text labels

label.family

Font family for text labels

label.fontface

Fontface for text labels

label.lineheight

Lineheight for text labels

label.hjust

Horizontal adjustment for text labels

label.vjust

Vertical adjustment for text labels

label.repel

Logical flag indicating whether to use ggrepel, enabling this may take some time for plotting

label.n

Number of points to be laeled in each plot, starting with the most extreme

smooth.colour

Line colour for smoother lines

smooth.linetype

Line type for smoother lines

ad.colour

Line colour for additional lines

ad.linetype

Line type for additional lines

ad.size

Fill colour for additional lines

nrow

Number of facet/subplot rows

ncol

Number of facet/subplot columns

...

other arguments passed to methods

Examples

Run this code
if (FALSE) {
autoplot(lm(Petal.Width ~ Petal.Length, data = iris))
autoplot(glm(Petal.Width ~ Petal.Length, data = iris), which = 1:6)
autoplot(lm(Petal.Width~Petal.Length, data = iris), data = iris, colour = 'Species')
}

Run the code above in your browser using DataLab