given the data below x1<-c(-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1,-1,0,1) y<-c(-1,-1,-1,0,0,0,1,1,1,-1,-1,-1,0,0,0,1,1,1,-1,-1,-1,0,0,0,1,1,1) z<-c(-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1) using maple i can fit as below and get (1) #PolynomialFit(3, x1, y1, z) ; Fit(a+b*(x^2+y^2+z^2), Matrix([x1,y1,z1]),m1,[x,y,z]); (1) my question, is there a way we can do the same in R (i.e to obtain (1) using R) [[alternative HTML version deleted]]