Skip to content
Prev 334119 / 398513 Next

How to generate a smoothed surface for a three dimensional dataset?

On Dec 5, 2013, at 9:46 PM, A Xi Ma wrote:

            
Right. the 'volcano'-object is a standard data object for demonstration of R graphics. It resides in the datasets package and has a help file:

help(volcano)
snipped superfluous output from an objects()-command.
They are both matrices. The Volcano matrix has only one-ninth the number of values.

The first small section of the volcano vignette reads:
------------------------------------------------------------------------
1. Intro

To make this vignette smaller, the size of volcano is reduced:

 # Reduce the resolution
 Volcano <- volcano[seq(1, nrow(volcano), by = 3),

                     seq(1, ncol(volcano), by = 3)]
-------------------------------------------------------------------------
So that code just selects every third of the values of the 'volcano' matrix.
It is accessible by functions although it is not visible in the workspace.
num [1:87, 1:61] 100 101 102 103 104 105 105 106 107 108 ...
[1] FALSE

If you want to get it into the workspace, you just use the data() function:
[1] TRUE    # now "visible"
I'm thinking you are not yet ready for plot3D. It's unclear what level of effort you have put in to reading and mastering the "Introduction to R" or whatever text you are using to educate yourself. I certainly do not think that a beginning tutorial in R was the goal that the authors of the plot3D package had in mind. Even before posting to Rhelp you are expected to have studied the available documentation and learned enough R to be able to answer all the questions you posed. So I suggest studying your copy of Introduction to R that is shipped with every binary of R.
And you should learn to post in plain text. Please do read the Posting Guide.
David Winsemius
Alameda, CA, USA