I need to pass a set of coefficients to ggplot2, and plot that equation.
stat_function() does not seem to work with anything but one variable, and I have 17.
Here's an example of a multivariate equation I would want
my_func <- function(a, b, c) {2*a -4*b + 8*c }
ggplot + stat_function(fun = my_func)
This is the output:
Warning message: “Computation failed in `stat_function()`: argument "b" is missing, with no default”
I also tried with
+ layer(stat = "function", fun = my_func)
No luck.
Also I might as well ask, I have various sets of these coefficients and it'd be great if I could build each "formula" automatically.
Thanks for the help!

my_funcand the error says'myfunc'. Correct this and see if it works. 2) What is the space (a, b, c) for your plots? And how do you want to plot a 3d space in 2d? Withfacte_wraporfacet_gridon one of the variables?df1 <- data.frame(a = seq(0, 10, by = 0.1))this plots a straight line:ggplot(df1, aes(x = a)) + stat_function(fun = my_func, args = list(b = 1, c = -2)). Can you post sample values fora,bandc?