Hello, I have created a Fitness surface (persp()), with data that was created by a tp spline procedure. Now I would like to superimpose a set (XYZ) of existing points (from two different treatments) onto this surface. I didn't come across any function or command that is able to do this in R. Could somebody please help me in finding a solution to this problem Thank you Peter -- Peter Kraft Department of Zoology and Entomology University of Queensland Brisbane 4072 Queensland Australia Email: pkraft at zoology.uq.edu.au Phone: +61 7 3365 1391 Fax: +61 7 3365 1655 Web: http://www.zen.uq.edu.au -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Kraft wrote:> > Hello, > I have created a Fitness surface (persp()), with data that was created > by a tp spline procedure. Now I would like to superimpose a set (XYZ) of > existing points (from two different treatments) onto this surface. > I didn't come across any function or command that is able to do this in R. > Could somebody please help me in finding a solution to this problemA message on R-help from Ben Bolker "[R] persp(): add second plane", dated 14 Mar 2002, answers your question. You'll find it in the mailing list archive. Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Kraft <pkraft at zoology.uq.edu.au> wrote:> I have created a Fitness surface (persp())... Now I would like to > superimpose a set (XYZ) of existing points ... onto this surface.Uwe Ligges <ligges at statistik.uni-dortmund.de> has already pointed out Ben Bolker's <ben at zoo.ufl.edu> excellent R-help message of 3/14/02, which I merely summarize here. Save your persp() invisible output as "pmat": R> pmat <- persp(...) Define the handy function "trans3d": R> trans3d <- function(x,y,z, pmat) { R> tmat <- t(cbind(x,y,z,1) %*% pmat) R> list(x=tmat[1,]/tmat[4,], y=tmat[2,]/tmat[4,]) R> } Now you can convert 3D coordinates to 2D coordinates for use with points, etc: R> points(trans3d(myx, myy, myz, pmat)) -- -- David Brahm (brahm at alum.mit.edu) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._