Learn R Programming

scplot (version 0.5.1)

add_line: Add line to an scplot

Description

Add line to an scplot

Usage

add_line(
  object,
  case = 1,
  x0 = NULL,
  y0 = NULL,
  x1 = NULL,
  y1 = NULL,
  hline = NULL,
  vline = NULL,
  color = "black",
  linewidth = 0.7,
  linetype = "solid"
)

Value

An object of class scplot (seescplot()) with added element lines.

Arguments

object

An scplot object (class scplot) returned from the scplot() function.

case

Numerical vector with the case number or character string. case = "all" for all cases.

x0

Origin x position of the line.

y0

Origin y position of the line.

x1

End x position of the line.

y1

End y position of the line.

hline

y position of horizontal line.

vline

x position of vertical line.

color

A character string or a number defining the color of an element.

linewidth

A number with the width of the line.

linetype

A character string with the line type: "solid", "dashed", "dotted"

Examples

Run this code
data(exampleAB, package = "scan")
p1 <- scplot(exampleAB$Anja)  |>
  add_line(hline = 70, color = "darkred") |>
  add_line(vline = 3, color = "blue") |>
  add_line(x0 = 1, y0 = 70, x1 = 4, y1 = 80, color = "green")

Run the code above in your browser using DataLab