plot.resp_surf: Plot the response surface model

View source: R/resp_surf.R

plot.resp_surfR Documentation

Plot the response surface model

Description

Plot the response surface model using a contour plot

Usage

## S3 method for class 'resp_surf'
plot(
  x,
  xlab = NULL,
  ylab = NULL,
  resolution = 100,
  bins = 10,
  plot_theme = theme_metan(),
  ...
)

Arguments

x

An object of class resp_surf

xlab, ylab

The label for the x and y axis, respectively. Defaults to original variable names.

resolution

The resolution of the contour plot. Defaults to 100. higher values produce high-resolution plots but may increase the computation time.

bins

The number of bins shown in the plot. Defaults to 10.

plot_theme

The graphical theme of the plot. Default is plot_theme = theme_metan(). For more details, see ggplot2::theme().

...

Currently not used

Value

An object of class ⁠gg, ggplot⁠.

Author(s)

Tiago Olivoto tiagoolivoto@gmail.com

Examples


library(metan)
# A small toy example

df <- data.frame(
 expand.grid(x = seq(0, 4, by = 1),
             y = seq(0, 4, by = 1)),
 z = c(10, 11, 12, 11, 10,
       14, 15, 16, 15, 14,
       16, 17, 18, 17, 16,
       14, 15, 16, 15, 14,
       10, 11, 12, 11, 10)
)
mod <- resp_surf(df, x, y, resp = z)
plot(mod)



TiagoOlivoto/metan documentation built on April 28, 2024, 10:47 a.m.