Skip to contents

The plot_OCcutlines2 function plots cutlines for a 2D Optimal Classification (OC) object. It visualizes the decision boundaries (cutlines) in a two-dimensional space based on the OC analysis results.

Usage

plot_OCcutlines2(
  x,
  main.title = "Cutting Lines",
  d1.title = "First Dimension",
  d2.title = "Second Dimension",
  lines = 50,
  dims = c(1, 2),
  lwd = 2,
  ...
)

Arguments

x

An object of class OCobject. This object should contain the results of an Optimal Classification analysis, including roll call data and norm vectors for plotting cutlines.

main.title

A character string specifying the title of the plot. Defaults to "Cutting Lines".

d1.title

A character string specifying the label for the first dimension (x-axis). Defaults to "First Dimension".

d2.title

A character string specifying the label for the second dimension (y-axis). Defaults to "Second Dimension".

lines

An integer specifying the number of cutlines to plot. If lines is a vector, it selects specific cutlines by their row indices. If lines is a single integer, it randomly selects that many cutlines to plot. Defaults to 50.

dims

A numeric vector of length 2 specifying the dimensions to be plotted. Defaults to c(1, 2).

lwd

A numeric value specifying the line width of the cutlines. Defaults to 2.

...

Additional graphical parameters passed to the symbols function.

Value

This function does not return a value but produces a object for plot.

Details

The function checks that the input object x is of class OCobject and that it contains two dimensions for plotting. If the lines parameter is a single integer, it will randomly select that many cutlines to display. If lines is a vector, it will use those specific rows from the roll call data to plot the cutlines.#' @importFrom yourpackage add_OCcutline

Examples

if (FALSE) { # \dontrun{
# Assuming `oc_result` is an OCobject with 2D results
plot_OCcutlines2(oc_result, lines = 10)
} # }