plot.BorgRisk: Plot BORG Objects

View source: R/borg_plot.R

plot.BorgRiskR Documentation

Plot BORG Objects

Description

S3 plot method for BORG risk assessment objects.

Usage

## S3 method for class 'BorgRisk'
plot(x, title = NULL, max_risks = 10, ...)

Arguments

x

A BorgRisk object from borg_inspect() or borg().

title

Optional custom plot title.

max_risks

Maximum number of risks to display. Default: 10.

...

Additional arguments (currently unused).

Details

Displays a visual summary of detected risks:

  • Hard violations shown in red

  • Soft inflation risks shown in yellow/orange

  • Green "OK" when no risks detected

Value

Invisibly returns NULL. Called for plotting side effect.

Examples

# No risks
data <- data.frame(x = 1:100, y = 101:200)
result <- borg_inspect(data, train_idx = 1:70, test_idx = 71:100)
plot(result)

# With overlap violation
result_bad <- borg_inspect(data, train_idx = 1:60, test_idx = 51:100)
plot(result_bad)


BORG documentation built on March 20, 2026, 5:09 p.m.