could someone explain to me why these two pieces of codes return two diferent things? the first one :
x<-y<-seq(from=-1,to=1,by=0.1)
one<-function(x,y){
x
}
z<-outer(x,y,FUN=one)
persp(x,y,z)
returns the surface it should.
while :
x<-y<-seq(from=-1,to=1,by=0.1)
one<-function(x,y){
array(1, dim=length(x))
}
z<-outer(x,y,FUN=one)
persp(x,y,z)
returns : "Error in persp.default(x, y, z = outer(x, y, one)) : invalid 'z' limits"