I want to use the plot3D
or persp3D
functions from package rgl
and already looked into the package description and the dummy-dataset "Volcano". But I'm actually not able to to the following with my data:
I have some data listed in 3 columns like
Col1 Col2 Col3
1 0.2 2
2 0.5 5
3 0.6 9
4 19 8
5 1.3 10
6 0.1 60
and I wanted to create a surface plot in 3D with persp3D
or plot3D
. Of course I have more data but cant list it here.
As I saw in the Volcano Plot (and if my suggestions are right) the Volcano data contains data, arranged like a matrix.
So I thought, to start I would like to set my data as a matrix like:
2 5 9 8 10
60 1 0.2 NA NA
NA 2 NA 0.5 NA
3 NA NA 0.6
4 NA NA NA 19
and so on
5
6
of course, I saw that the Matrix of Data from Volcano is complete and I have many NA
's. Is there a possibility to calculate the NA
s based on the model between the already measured values? I think the certainty of the calculated values is decreasing, the far away you calculate from the diagonal line of the measured values.
So now my questions:
How can I put my 3 columns into the matrix style and how can I calculate the missing NA
's?
Thank you very much in advance, Chris
see above