Add line to an scplot

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

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"

Value

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

Examples

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")