[R-sig-Geo] Is it possible to "bin" or grid ppp objects?

Marcelino de la Cruz marcelino.delacruz at upm.es
Sun Jun 30 22:07:17 CEST 2013


Hi LS,
you can us function tess to create a tesselation and then split your ppp 
with it. See this example:

data(lansing)
lansing
gridA<- tess(xgrid=seq(0,1, by=0.1), ygrid=seq(0,1,by=0.1))
gridA
plot(lansing)
plot(gridA, add=T)
lansing.g=split(lansing, gridA)
lansing.g
length(lansing.g)

lansing.g[[1]]
lansing.g[[1]]$n

Kest(lansing.g[[1]])
Kest(lansing.g[[2]])
...
Kest(lansing.g[[100]])



HTH,

Marcelino

El 30/06/2013 19:43, L S escribió:
> Hi,
>
> I am not very savvy with spatial data analysis (though I am doing my best
> to learn).  I have embarked on a spatial analysis project and am not sure
> whether what I would like to do is possible.
>
> My dataset is over 500,000 points (with lat, long attributes as well as a
> single numerical attribute).  The data was not collected in a spatially
> regular or predictable way--the points are all over the place, with some
> areas having greater concentration of points.
>
> I created a point process object with my data, using a shape file as the
> observation window (owin).  I have been trying, with no success, to divide
> this owin into a regular grid.  For example, could I create 0.5 x 0.5
> degree (or in any other measurement) gridded squares over the owin and then
> access the points in each square?  The purpose is to be able to analyze the
> points in each grid independently and to be able to visualize the data
> using the grids (such plotting the mean of points within the grid cell
> instead of each individual point).
>
> The most promising r function I have found thus far is the quadrantcount
> function in spatstat where the owin is divided into grid cells and the
> number of points in each cell is counted.  However, I am unable to access
> the points in each cell created by quadrantcount--is this possible at all?
>   For example, one cell may have 2000 points...can I then put those points
> in a data frame and do data analysis on just those?  Or, alternatively, to
> use those cells for plotting the mean value of the points?
>
> Any advice would be greatly appreciated.  I look forward to hearing your
> feedback and guidance.
>
> Thanks,
> LS
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list