subtractlm | R Documentation |
This returns a new function which a linear model has an r-squared of 0.
subtractlm(func, d, n = d * 100)
func |
A function |
d |
Number of input dimensions |
n |
Number of points to use for the linear model |
A new function
subtractlm(ackley, 2)
f <- function(x) {
if (is.matrix(x)) x[,1]^2
else x[1]^2
}
ContourFunctions::cf(f)
ContourFunctions::cf(subtractlm(f, 2), batchmax=Inf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.