resp_surf: Response surface model

View source: R/resp_surf.R

resp_surfR Documentation

Response surface model

Description

[Stable]

Compute a surface model and find the best combination of factor1 and factor2 to obtain the stationary point.

Usage

resp_surf(
  .data,
  factor1,
  factor2,
  rep = NULL,
  resp,
  prob = 0.05,
  verbose = TRUE
)

Arguments

.data

The dataset containing the columns related to Environments, factor1, factor2, replication/block and response variable(s).

factor1

The first factor, for example, dose of Nitrogen.

factor2

The second factor, for example, dose of potassium.

rep

The name of the column that contains the levels of the replications/blocks, if a designed experiment was conducted. Defaults to NULL.

resp

The response variable(s).

prob

The probability error.

verbose

If verbose = TRUE then some results are shown in the console.

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)



metan documentation built on March 7, 2023, 5:34 p.m.