On 05/09/11 06:26, awesolow wrote:
Hi,
I have a set of x, y points (longitude/latitude) along with a z value
representing an attribute at each point. I want to create a
Voronoi/Dirichlet tesselation of these points coloring each tile by the z
value. I tried searching for a way to solve this and it was suggested to
use the dirichlet() command to get the correct coloring. However, my
coloring is not correct.
Any thoughts?
Does something like this do what you want?
require(deldir)
set.seed(42)
x <- runif(20)
y <- runif(20)
z <- sample(1:6,20,TRUE)
d <- deldir(x,y)
td <- tile.list(d)
plot(td,polycol=z,close=TRUE)
Note that the tiling assumes planar Euclidean distance, which might
create distortion in dealing with points on a sphere if the region in
which you observe the points is large.
cheers,
Rolf Turner
______________________________________________
R-help@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.