The curve function in R provides a simple way to plot a function. For example, this will plot a straight line
f1 <- function(x) x
curve(f1, from=-1, to=1)
Is there an equivalent function in R which takes a function with two argument (e.g., x and y) and ranges for both variables and produces a 3D plot?
For example, imagine I had the following function
f2 <- function(x, y) x + y
Is there a command similar to the following?
curve_3d(f2, x_range=c(-1, 1), y_range=c(-1, 1))
