[R] what am I missing

2007-09-10 Thread Jan de Leeuw
x-seq(-1,1,length=10) y-seq(-1,1,length=10) a-matrix(c(1,2,2,1),2,2) b-matrix(c(2,1,1,2),2,2) fv-function(x,y) { m-x*a+y*b t-m[1,1]+m[2,2]; d-m[1,1]*m[2,2]-m[1,2]^2 return((t-sqrt(t^2-4*d))/2) } gv-function(x,y) { t-x*(a[1,1]+a[2,2])+y*(b[1,1]+b[2,2])

Re: [R] what am I missing

2007-09-10 Thread Gabor Grothendieck
Its a FAQ: http://hermes.sdu.dk/Rdoc/faq.html#Why%20does%20outer()%20behave%20strangely%20with%20my%20function%3f On 9/10/07, Jan de Leeuw [EMAIL PROTECTED] wrote: x-seq(-1,1,length=10) y-seq(-1,1,length=10) a-matrix(c(1,2,2,1),2,2) b-matrix(c(2,1,1,2),2,2) fv-function(x,y) {