Dear R users,

I have created a Loess surface in R, in which x is relative longitude by
miles, y is relative latitude by miles, and z is population density at the
neighborhood level. The purpose is to identify some population centers in
the region. I'm wondering if there is a way to determine the coordinates
(x,y) of each center, so I can know exactly where they are.

Let me use the "elevation" data set in geoR to illustrate what have done:

require(geoR)

data(elevation)

elev.df <- data.frame(x = 50 * elevation$coords[,"x"], y = 50 *
elevation$coords[,"y"], z = 10 * elevation$data)

elev.loess <- loess(z ~ x * y, data = elev.df, degree = 2, span = 0.1)

grid.x <- seq(10, 300, 1)
grid.y <- seq(10, 300, 1)
grid.mar <- list(x=grid.x, y=grid.y)
elev.fit<-expand.grid(grid.mar)

z.pred <- predict(elev.loess, newdata = elev.fit)

persp(seq(10, 300, 5), seq(10, 300, 5), emp.pred, phi = 45, theta = 45,
xlab = "X Coordinate (feet)", ylab = "Y Coordinate (feet)", main = "Surface
elevation data")

With this, what's the right way to determine the coordinates of the local
maixma on the surface?

Thanks.

Gary

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to