Re: [R] Smoothing z-values according to their x, y positions

From: Bert Gunter <gunter.berton_at_gene.com>
Date: Wed, 19 Mar 2008 14:10:33 -0700

There are dozens of functions within R and contributed packages that do this. The spatial statistics packages (see the "spatial" task view on CRAN) is certainly where most are concentrated, but thin plate splines (in splines packages, I believe), tensor product splines (in mgcv package), local likelihood (in locfit package) etc. are also available for spatial smoothing. Perhaps the most basic place to look is the ?loess function in the base distribution, which will do exactly what you requested.

Bert Gunter
Genentech Nonclinical Statistics

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Emmanuel Levy
Sent: Wednesday, March 19, 2008 12:42 PM To: r-help_at_r-project.org
Subject: [R] Smoothing z-values according to their x, y positions

Dear All,

I'm sure this is not the first time this question comes up but I couldn't find the keywords that would point me out to it - so apologies if this is a re-post.

Basically I've got thousands of points, each depending on three variables: x, y, and z.

if I do a plot(x,y, col=z), I get something very messy.

So I would like to smooth the values of z according to the values of their neighbors (given by x and y).

Could you please point me out to the function(s) I should look into for the smothing, and
possibly for the plotting?

Many thanks for your help,

Emmanuel



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 19 Mar 2008 - 21:14:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 19 Mar 2008 - 23:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive