Skip to content

3D plots with data.frame

3 messages · H. Paul Benton, J.delasHeras at ed.ac.uk, Duncan Murdoch

#
Dear all, 
 
    Thank you for any help. I have a data.frame and would like to plot
it in 3D. I have tried wireframe() and cloud(), I got

scatterplot3d(xs)
Error: could not find function "scatterplot3d"
Error in wireframe(xs) : no applicable method for "wireframe"
Error in persp.default(x = x, y = y, z = xs) :
        (list) object cannot be coerced to 'double'
[1] "data.frame"
Where x and y were a sequence of my min -> max by 50 of xs[,1] and xs[,2].

my data is/looks like:
[1] 400   4
x       y     Z1     Z2
1 27172.4 19062.4      0    128
2 27000.9 19077.8      0      0
3 27016.8 19077.5      0      0
4 27029.5 19077.3      0      0
5 27045.4 19077.0      0      0

    Cheers,

    Paul
#
You could try the function 'plot3d', in package 'rgl':

library(rgl)
?plot3d
x<-data.frame(a=rnorm(100),b=rnorm(100),c=rnorm(100))
plot3d(x$a,x$b,x$c)

Jose


Quoting "H. Paul Benton" <hpbenton at scripps.edu>:

  
    
#
On 25/05/2007 8:22 PM, J.delasHeras at ed.ac.uk wrote:
Or more simply, plot3d(x) (which plots the 1st three columns).

Duncan Murdoch