plot.resp_surf: Plot the response surface model

Description Usage Arguments Value Author(s) Examples

View source: R/resp_surf.R

Description

Plot the response surface model using a contour plot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

metan documentation built on Nov. 10, 2021, 9:11 a.m.