[R] help working with persp plot function

Steven K Friedman friedm69 at msu.edu
Mon Oct 4 00:08:57 CEST 2004


Hi, 

I don't understand why this is not working.  Help is appreciated. 

I need to plot the following as a surface, but persp returns an error. 

tpcp_xy[1:10,]
   X_COORD  Y_COORD TPCP
1  465459.7 175924.1 0.85
2  466145.8 324017.3 2.30
3  467720.2 372143.1 1.56
4  470293.2 348064.8 2.87
5  476566.9 205501.8 0.94
6  477774.9 142561.0 1.31
7  479207.0 162919.6 3.04
8  480890.8 290641.3 2.20
9  488865.9 159201.4 2.30
10 490328.3 248049.0 2.81 


Note that the X_COORD column is sorted in an increasing order. 

> objects(2)
[1] "TPCP"    "X_COORD" "Y_COORD"
> persp(X_COORD, Y_COORD, TPCP)
Error in persp.default(X_COORD, Y_COORD, TPCP) :
       increasing x and y values expected 

Ok so why is the function returning an error message? 

Thanks for your time and insights. 

Steve Friedman           email friedm69 at msu.edu
Department of Forestry
Michigan State University




More information about the R-help mailing list