Plot method for BRIL objects

# S3 method for BRIL
plot(
  x,
  contents = "plot",
  showClusters = TRUE,
  showMode = TRUE,
  col,
  colMode,
  colClusters = NULL,
  iterationsIndices = NULL,
  iterationsOptions = NULL,
  ...
)

Arguments

x

An object of class BRIL (see bril())

contents

Contents to be displayed, options are "scatterplot", or "iterations" (only one option possible)

showClusters

Logical value used when contents = "scatterplot", to show or not the different clusters

showMode

Logical value used when contents = "scatterplot", to show or not the main mode

col

Default color of samples

colMode

Color of the mode when contents = "scatterplot"

colClusters

List (or array) of colors for each of the clusters/iterations (length must be at least equal to the number of groups identified by the function bril(), i.e. x$nbClusters)

iterationsIndices

Numerical value or array of numerical values, used when contents = "iterations", which provides the indices of the iterations to be plotted. If more than one iteration is requested, an interactive menu in the console will be used for the selection. 0 or NULL (default) will include all the iterations. Values that are negative or superior to the number of iterations performed by the execution bril() will be ignored

iterationsOptions

List of additional parameters to be passed to the plot.BRIL.Filtering() function when contents = "iterations" is selected (see plot.BRIL.Filtering() for details). Example: iterationsOptions = list(xlab = NA, ylab = NA, contents = c("p.values", "scatterplot"), asp = 1)

...

Other arguments passed to or from other methods (such as pch for the symbols, main and sub for title and subtitle, xlab, xmin, ...)

See also

Examples

# Create a sample distribution and run bril() function XY <- rbind( mvtnorm::rmvnorm(300, c(0, 0), diag(2) * 3 - 1), mvtnorm::rmvnorm(100, c(15, 20), diag(2)), mvtnorm::rmvnorm(150, c(-10, 15), diag(2) * 2 - 0.5), mvtnorm::rmvnorm(200, c(5, 5), diag(2) * 200) ) res <- bril(XY, debug = TRUE) # Plot the mode and groups encountered (default) plot(res)
# Plot the mode only plot(res, showClusters = FALSE)
# Plot the mode only (with extra graphic options) plot(res, showClusters = FALSE, main = "Multivariate Mode Estimate", col = "blue", colMode = "black", asp = 1, pch = 3 )
# Plot the clusters without the mode plot(res, showMode = FALSE, col = "gray", colClusters = c("yellow","cyan","purple","red"))
# Plot the second iteration plot(res, contents = "iteration", iterationsIndices = 2)
# Plot the second iteration (with arguments to plot.BRIL.filtering()) plot(res, contents = "iteration", iterationsIndices = 2, iterationsOptions = list( contents = c("scatterplot", "p.values"), colSelection = "blue", mfrow = c(2,1), asp = 1))
if (FALSE) { # Plot all iterations (interactive mode) plot(res, contents = "iterations") # Plot the 3 first iterations with options (interactive mode) plot(res, contents = "iterations", iterationsIndices = c(1:3), iterationsOptions = list( contents = c("scatterplot"), xlim = c(-50,50), ylim = c(-30,30), asp = 1)) }