plot.resp_surf {metan}R 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)



[Package metan version 1.18.0 Index]