Learn R Programming

BORG (version 0.2.5)

plot.BorgRisk: Plot BORG Objects

Description

S3 plot method for BORG risk assessment objects.

Usage

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

Value

Invisibly returns NULL. Called for plotting side effect.

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

Examples

Run this code
# 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)

Run the code above in your browser using DataLab