plot: Generic Plot Function

View source: R/fuzzy_plot.R

plotR Documentation

Generic Plot Function

Description

This is a generic plot function that dispatches to specific plot methods based on the class of the object provided. It is used to create plots for objects such as fuzzy_lm.

Usage

plot(object, ...)

Arguments

object

The object to be plotted.

...

Additional arguments passed to specific plot methods.

Value

Depends on the class of object. Typically, a plot or visualization is returned.

Examples

# Example with fuzzy_lm:
set.seed(123)
x_crisp <- seq(4, 12, length.out = 20)
beta <- 1.5
intercept <- 2
y_crisp <- intercept + beta * x_crisp + rnorm(length(x_crisp), mean = 0, sd = 0.5)

# Fuzzify data
spread_x <- 0.5
spread_y <- 1.0
X_fuzzy <- fuzzify_crisp_matrix(matrix(x_crisp, ncol = 1), spread = spread_x)
Y_fuzzy <- fuzzify_crisp_vector(y_crisp, spread = spread_y)

# Fit fuzzy regression model
object <- fuzzy_lm(X_fuzzy, Y_fuzzy, p = 1)

# Plot

plot(object, X_fuzzy = X_fuzzy, Y_fuzzy = Y_fuzzy)


flex documentation built on Sept. 2, 2025, 9:09 a.m.

Related to plot in flex...