add_marks {scplot}R Documentation

Add marks to an scplot

Description

Add marks to an scplot

Usage

add_marks(
  object,
  case = 1,
  positions,
  color = "red",
  size = 1,
  shape = 1,
  variable = ".dvar"
)

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.

positions

Either a vector indicating the points to be highlighted or a character string with a logical expression (e.g. values < mean(values))

color

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

size

Text size relative to the base text size.

shape

Number. See pch graphical parameter on par help page par().

variable

Name of the dataline variable to apply the style.

Details

If positions is an object returned from an outlier analysis (outlier()), the corresponding outliers are marked.

Value

An object of class scplot (seescplot()) with changed element marks.

Examples

library(scan)
p1 <- scplot(exampleA1B1A2B2$Moritz) |> add_marks(positions = c(1,5,10,14))
p1 <- scplot(Huber2014) |> add_marks(positions = outlier(Huber2014))

[Package scplot version 0.3.3 Index]