[R] wireframe advice - with reproducible code

Duncan Murdoch murdoch.duncan at gmail.com
Mon May 16 17:24:13 CEST 2011


On 16/05/2011 11:17 AM, Chris Mcowen wrote:
> Thanks for this,
>
> With the data i have what is the best method to convert it into the required matrix, as i am a little unsure how it would be done - i imagine this must be a common task?

You can't convert it.  Your data doesn't form a surface.

You could fit a model that had a prediction surface, but there isn't a 
single best way to do that.  It depends on the best model for your data, 
which depends on much more than just the set of points.

Duncan Murdoch

> Chris
> On 16 May 2011, at 16:05, Duncan Murdoch wrote:
>
> On 16/05/2011 10:57 AM, Chris Mcowen wrote:
> >  Sorry,
> >
> >  My bad -
> >
> >  I have notice you can remove the data call when using this and it works the same,  also FD is the same as Residual_FD i just forgot i coded it different.
> >
> >  wireframe(FD ~ Elevation * Temperature, scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE)
> >
> >  Sorry and thanks again,
> >
>
> Those points don't form a surface that wireframe could draw.  cloud() would work, but if you want a wireframe surface, then the FD values need to be something like what persp() needs:  a matrix of values, with rows and columns being combined values from Elevation and Temperature.  wireframe() is different in that the matrix is presented as a column in the data, with the rows and columns repeated correspondingly.
>
> See the g dataframe produced in example(wireframe) for an example of the right sort of structure.
>
> Duncan Murdoch
>
>
>
>
>



More information about the R-help mailing list