plot.depthgram: Specialized method to plot 'depthgram' objects

Description Usage Arguments Value References Examples

View source: R/depthgram.R

Description

This function plots the three 'DepthGram' representations from the output of the depthgram function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## S3 method for class 'depthgram'
plot(
  x,
  limits = FALSE,
  ids = NULL,
  print = FALSE,
  plot_title = "",
  shorten = TRUE,
  col = NULL,
  pch = 19,
  sp = 2,
  st = 4,
  sa = 10,
  text_labels = "",
  ...
)

Arguments

x

An object of class depthgram as output by the depthgram function.

limits

A boolean specifying whether the empirical limits for outlier detection should be drawn. Defaults to FALSE.

ids

A character vector specifying labels for individual observations. Defaults to NULL, in which case observations will named by their id number in order of appearance.

print

A boolean specifying whether the graphical output should be optimized for printed version. Defaults to FALSE.

plot_title

A character string specifying the main title for the plot. Defaults to "", which means no title.

shorten

A boolean specifying whether labels must be shorten to 15 characters. Defaults to TRUE.

col

Color palette used for the plot. Defaults to NULL, in which case a default palette produced by the hcl function is used.

pch

Point shape. See plotly for more details. Defaults to 19.

sp

Point size. See plotly for more details. Defaults to 2.

st

Label size. See plotly for more details. Defaults to 4.

sa

Axis title sizes. See plotly for more details. Defaults to 10.

text_labels

A character vector specifying the labels for the individuals. It is overridden if limits = TRUE, for which only outliers labels are shown. See plotly for more details. Defaults to "".

...

Other arguments to be passed to the base plot function. Unused.

Value

A list with the following items:

References

Aleman-Gomez, Y., Arribas-Gil, A., Desco, M. Elias-Fernandez, A., and Romo, J. (2021). "Depthgram: Visualizing Outliers in High Dimensional Functional Data with application to Task fMRI data exploration".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
N <- 50
P <- 50
grid <- seq(0, 1, length.out = P)
Cov <- exp_cov_function(grid, alpha = 0.3, beta = 0.4)

Data <- list()
Data[[1]] <- generate_gauss_fdata(
  N,
  centerline = sin(2 * pi * grid),
  Cov = Cov
)
Data[[2]] <- generate_gauss_fdata(
  N,
  centerline = sin(2 * pi * grid),
  Cov = Cov
)
names <- paste0("id_", 1:nrow(Data[[1]]))
DG <- depthgram(Data, marginal_outliers = TRUE, ids = names)
plot(DG)

roahd documentation built on Nov. 4, 2021, 1:07 a.m.