I have constructed in R a two variable integer valued function f(x,y) which is only well – defined for single entries (not for example f(1,1:5)). I am effectively looking for an integer valued function F(x,y,z,w) which would give the output:
f(x,y),f(x,y+1),...,f(x,w),f(x+1,y),f(x+1,y+1),...,f(x+1,w),...,f(z,y),f(z,y+1),...,f(z,w)
as a (z-x+1) by (w-y+1) matrix. Cheers for any help!
outerseems to be what you’re looking for here.If it’s true that your function really only can take scalars as the input then you may need to use
Vectorizeto make this approach work