Learn R Programming

ggfortify (version 0.4.17)

autoplot.cv.glmnet: Autoplot glmnet::cv.glmnet

Description

Autoplot glmnet::cv.glmnet

Usage

# S3 method for cv.glmnet
autoplot(
  object,
  sign.lambda = 1,
  label.n = 12,
  label = TRUE,
  label.label = "nz",
  label.colour = NULL,
  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,
  xlim = c(NA, NA),
  ylim = c(NA, NA),
  log = "",
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  asp = NULL,
  ...
)

Value

ggplot

Arguments

object

glmnet::cv.glmnet instance

sign.lambda

Either plot against log(lambda) (default) or its negative if sign.lambda=-1.

label.n

Number of Df labels

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

xlim

limits for x axis

ylim

limits for y axis

log

which variables to log transform ("x", "y", or "xy")

main

character vector or expression for plot title

xlab

character vector or expression for x axis label

ylab

character vector or expression for y axis label

asp

the y/x aspect ratio

...

other arguments passed to methods

Examples

Run this code
if (requireNamespace("survival", quietly = TRUE)) {
  autoplot(glmnet::cv.glmnet(data.matrix(Orange[-3]), data.matrix(Orange[3])))
}

Run the code above in your browser using DataLab