Description Usage Arguments Value Examples
View source: R/utils-approximations.R
It approximates data with spline function by fitting GAM model.
1 2 3 4 5 | approx_with_spline(effect_data, response, predictor,
env = parent.frame(), ...)
approx_with_monotonic_spline(effect_data, response, predictor,
env = parent.frame(), monotonic, ...)
|
effect_data |
Black box response data, for example pdp curve. |
response |
Name of response value from effect_data. |
predictor |
Name of predictor value from effect_data. |
env |
Formula environment that should be used for fitting gam model. |
... |
Other arguments passed to s function. |
monotonic |
Possible options "up", "down" and "auto. If up the spline is increasing, when down decreasing. |
Object of class "gam". See gamObject
1 2 3 4 5 6 | x <- sort(rnorm(20, 5, 5))
y <- rnorm(20, 2, 2)
env <- new.env()
approx_with_spline(data.frame(x = x, y = y), "y", "x", env)
approx_with_monotonic_spline(data.frame(x = x, y = y), "y", "x", env, "up")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.