So I need an array where each point corresponds to a value of a function on those coordinates. Until now, I was dealing with 2d functions so I just did this:
x <- seq(a1,b1, length.out = 10000)
y <- seq(a2,b2, length.out = 10000)
func <- outer(x,y,FUN)
Where I define the domain of my variables above, and below it generates a matrix where each point is the value of my function "FUN" at those coordinates. However, now I need to do this for a function that takes in 4 variables.
I want it to be a 4d array but I don't know how to achieve this without resorting to a bunch of 'for' cycles, which I really don't want to.