An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100513/36312c76/attachment.pl>
Help with Voronoi Tesselation
3 messages · Josef Fruehwald, Carson Farmer, Alok K Bohara, PhD
Does this help at all? http://www.carsonfarmer.com/?p=455 Carson
On Fri, May 14, 2010 at 1:39 AM, Josef Fruehwald <jofrhwld at gmail.com> wrote:
Hi All,
I'm somewhat of a novice at doing spatial analysis in R, so forgive me if my
question is obvious, or misposted.
I have a number of points located within the United States. My goal is to
compute the voronoi tessellation, bounded by the borders of the US. I would
like to eventually format this as a dataframe of coordinates with a grouping
ID column so that I can plot the polygons in ggplot2.
Here's what I've got so far.
cities <- structure(list(CitState = c("SiouxFalls SD", "Rockford IL",
"Kenosha WI",
"Duluth MN", "SiouxCity IA", "CedarRapids IA", "NewYork NY"),
? ?Latitude = c(43.54599, 42.265973, 42.577791, 46.779135, 42.489678,
? ?41.976662, 40.756054), Longitude = c(-96.731291, -89.086667,
? ?-87.822644, -92.108243, -96.404948, -91.673155, -73.986951
? ?)), .Names = c("CitState", "Latitude", "Longitude"), row.names = c(1L,
2L, 3L, 4L, 5L, 6L, 267L), class = "data.frame")
library(maps)
library(spatstat)
us <- data.frame(map("usa", regions = "main",plot = F)[c("x","y")])
manhattan <- data.frame(map("usa", regions = "manhattan",plot =
F)[c("x","y")])
spatstat.options(checkpolygons = FALSE)
us.win <- owin(poly = list(list(x = us$x, y = us$y),list(x = manhattan$x,y =
manhattan$y)))
us.ppp <- ppp(cities$Longitude, cities$Latitude, window = us.win)
But, if I use dirichlet() on us.ppp, it gives me back a pixel array. If I
use deldir() on us.ppp, the boundaries of the tesselations don't seem to be
constrained by the US borders, and I can't figure out how to extract the
polygons from the object.
plot(dirichlet(us.ppp))
##
map("usa")
plot(deldir(us.ppp), wlines = "tess",add = T)
If I could extract from some object, a list of polygons, I could probably
get the rest done myself.
Thanks in advance!
-Joe
? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Carson J. Q. Farmer ISSP Doctoral Fellow National Centre for Geocomputation National University of Ireland, Maynooth, http://www.carsonfarmer.com/
Dear all: Do you know of any R package that can to do spatial regression poisson or spatial regression NB model (not using the filtering) by taking into account the spatial correlation --neighborhood effect. I am looking for something that can do e.g., CAR type models. I used spatcounts to do a spatial poisson but the spatial correlation (gamma and psi) both turned out to be 0, showing that there is no spatial effect (I think). Yet, I know there is a strong spatial effect in my data. I just have a one set of count data on 800 cells with co-variates (30 % with 0) --that is, no repeated counts for each cells. Thanks. Best, Alok Bohara
Alok K. Bohara, Ph.D. Professor Department of Economics MSC 05 3060 1 University of New Mexico Albuquerque, NM 87131-0001, USA Ph: 505-277-5903/5304(w) Fax:505-277-9445 email: bohara at unm.edu http://www.unm.edu/~econ/faculty/professors.html Nepal Study Center: http://nepalstudycenter.unm.edu