Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

draw.ddplot

Draw DD-Plot


Description

The function draws the DD-plot either of the existing DDα-classifier of the depth space. Also accessible from plot.ddalpha.

Usage

draw.ddplot(ddalpha, depth.space, cardinalities, 
            main = "DD plot", xlab = "C1", ylab = "C2", xlim, ylim,
            classes = c(1, 2), colors = c("red", "blue", "green"), drawsep = T)

Arguments

ddalpha

DDα-classifier (obtained by ddalpha.train).

depth.space

The ready depth space obtained by depth.space.

cardinalities

Numerical vector of cardinalities of each class in data, each entry corresponds to one class.

main

an overall title for the plot: see title

xlab, ylab

class labels

xlim, ylim

range of axis

classes

vector of numbers of two classes used for depth calculation

colors

vector of the classes' colors

drawsep

draws the separation on the DD-plot (currently for 2 classes and not for knn)

See Also

Examples

data = getdata("kidney")
  
  #1. using the existing ddalpha classifier
  ddalpha = ddalpha.train(data, depth = "spatial")
  draw.ddplot(ddalpha, main = "DD-plot")
  
  #2. using depth.space.
  # Sort the data w.r.t. classes
  data = rbind(data[data$C == 1,], data[data$C == 2,])
  cardinalities = c(sum(data$C == 1), sum(data$C == 2))
  
  dspace = depth.space.spatial(data[,-6], cardinalities = cardinalities)
  draw.ddplot(depth.space = dspace, cardinalities = cardinalities, 
              main = "DD-plot", xlab = 1, ylab = 2)

ddalpha

Depth-Based Classification and Calculation of Data Depth

v1.3.11
GPL-2
Authors
Oleksii Pokotylo [aut, cre], Pavlo Mozharovskyi [aut], Rainer Dyckerhoff [aut], Stanislav Nagy [aut]
Initial release
2020-01-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.