[R] help to use ppp in spatial analysis
Ricardo Perrone
perrone at rocketmail.com
Fri Mar 6 14:59:34 CET 2009
Hi,
i am using spatstat package for spatial data analysis and now i have a problem to create a point pattern. The points are in file "points.txt" (first column for Latitude and second column for Longitude ) and I imported them and separated each columns in two arrays x and y. If I plots x and y ( e.g plot(x,y) ) the result appears in square area without problems and the scale is adequate to visual analysis of points ploted. But if i try to use ppp function to create a point pattern the result appears in rectangle area with a poor scale, dificulting in this case the analysis of the points. I think that is probably because of xrange and yrange parameter of ppp function, that was calculated based on max and min values of both x and y, but i am not sure:
latitude <- dataset$V2
longitude <- dataset$V3
xrange <-c(min(longitude), max(longitude))
yrange <-c(min(latitude), max(latitude))
area <- ppp(longitude/10000, latitude/100000, xrange, yrange) /* there are 181 point in file */
plot(longitude, latitude) / * square area of visualisation has an adequate scale to analysis */
plot(area) /* poor rectangle area of visualisation showing point too concentrated and hiding details - possible hot spots */
Is there a way of automatically define the size of window parameter (owin object) in ppp function from dataset of points? How can i scale the window without problems like:
"warning message: 181 points were rejected as lying outside the specified window"
Thanks
Ricardo
More information about the R-help
mailing list