[R] persp Error. x,y,z with the same length
Felix Wave
felix-wave at vr-web.de
Wed Apr 11 16:55:58 CEST 2007
Hello,
I have a problem in drawing a 3d graphic. I simplified the program to show you the problem.
I have a text file with hundreds of entries in 3 columns. I scaned these columns with matrix(scan). Then, I transformed some datas. Now I have the datas in h,x,y.
I created a new matrix to use persp . But I got an error. The reason is probably the same length of x,y,z.
But what can I do the draw my datas in a 3d graphic? (I want to use persp resp. image)
Thanks a lot!
Felix
the code:
------------
h <- Measure3[,4]
x <- Measure3[,3]
y <- Measure3[,2]
z <- matrix(c(x,y,h),ncol=3)
z
persp(x, y, z)
> z
[,1] [,2] [,3]
[1,] 0.0 0 0.000000000
[2,] 0.1 0 0.000538990
[3,] 0.2 0 0.002315760
[4,] 0.3 0 0.005333315
[5,] 0.4 0 0.009595005
[6,] 0.5 0 0.015104450
[7,] 0.6 0 0.021865495
[8,] 0.7 0 0.029882130
[9,] 0.8 0 0.039158475
[10,] 0.9 0 0.049698760
Default in persp.default(x, y, z) : increasing 'x' and 'y' values expected
More information about the R-help
mailing list