Learn R Programming

EmpiricalDynamics (version 0.1.2)

plot_surface_3d: 3D Response Surface

Description

Creates a 3D surface or contour plot showing how the target variable depends on two predictors.

Usage

plot_surface_3d(
  data,
  x_var,
  y_var,
  z_var,
  type = c("contour", "filled_contour", "persp"),
  n_grid = 30,
  method = "loess"
)

Value

A plot (base graphics for persp, ggplot for contour).

Arguments

data

Data frame.

x_var

First predictor variable.

y_var

Second predictor variable.

z_var

Response variable (target).

type

Plot type: "contour", "filled_contour", or "persp".

n_grid

Grid resolution for surface estimation.

method

Surface fitting method: "loess", "gam", or "linear".