plot_g_contour: Plot g-function as a static contour (for reports)

View source: R/plot_results.R

plot_g_contourR Documentation

Plot g-function as a static contour (for reports)

Description

Creates a ggplot2 visualization for any g-function group. For d <= 1, produces a 2D scatter plot (same as plot_g_function()). For d >= 2, produces a filled contour plot suitable for static formats like PDF and Word.

Usage

plot_g_contour(earth_result, group_index, response_idx = NULL)

Arguments

earth_result

An object of class "earthUI_result" as returned by fit_earth().

group_index

Integer. Index of the g-function group (1-based, from list_g_functions()).

response_idx

Integer or NULL. For multivariate models, which response column to plot (1-based). Default NULL uses the first response.

Value

A ggplot2::ggplot object.

Examples


result <- fit_earth(mtcars, "mpg", c("cyl", "disp", "hp", "wt"))
plot_g_contour(result, 1)


earthUI documentation built on March 26, 2026, 1:07 a.m.