I have a some data in an exel file with 128 rows and 400 column.I am reading this Excel file into a Matrix with 128X400. Now I want to draw 3D Plott using presp in r. Which parameters from this Matrix should be passed to persp?
UPDATE
I have this Matrix for example and I want to generate a 3D Plot, but I get an error:
k<-c(1,2,3,4,5,6,7,8,9,10,11,12,62,25,2)
k<-matrix(k,nrow=3)
op <- par(bg = "white")
persp(ncol(k), nrow(k), k, theta = 30, phi = 30, expand = 0.5, col = "lightblue")
Error:
Error in persp.default(ncol(k), nrow(k), k, theta = 30, phi = 30, expand = 0.5, :
invalid 'x' argument
matrix
, not adata.frame
, by usingclass()
). Just feed that into thez
parameter ofpersp()
:persp(z=foo)