1

First I'm really sorry because I'm newR, so I apologise if I missed a previous respond to this question, and I also apologise because I can not join pictures to my text (and I apologise for english fault because I'm not bilingual).

I'm working with Q-GIS and R. I have a forest (layer = parcels) with georeferenced specific trees (layer = coordinates of specific trees). I want to know if those specific trees are agregates. Therefore I import my Q-GIS layer on R which shows my specific trees (package rgdal, function readOGR).

Then I calculate the clark evans indice (package spatstat, function clarkevans.test) using the following line. Clark evans indice is the ratio of observed mean nearest neighbour distance to adjusted theoretical mean. (R=0 : complete agregation. R=1 : complete random. R=2.14914 : uniform pattern.)

clarkevans.test(PPP, correction="Donnelly", alternative="two.sided")

Where PPP is the format ppp of my layer specific trees :

PPP <- ppp(x = coordinates(spec_trees)[,1], y = coordinates(spec_trees)[,2], xrange = range(coordinates(spec_trees)[,1]), yrange = range(coordinates(spec_trees)[,2]))

And where the Donnelly correction is a correction for a rectangle window. I'm not sure if I have to use it or not. When there is no correction, I have almost the same result.

To the clark envans test, R responds :

R = 0.48929, p-value = 0.002
alternative hypothesis: two-sided

Which means my points are significantly different from a spatial random distribution (p-value > 0.05) AND my points are agregates (R<1).

BUT, I think R might over estimates the agregation, and I need the true value. My forest (layer = parcels) is not a square or an oval. Parcels are discontinues (there are lakes, roads, houses) ! Trees can not be everywhere in the square, where there are no parcels, there can be no trees, so of course there are no specific_trees. But R does not know that, so it just search agregation of specific_trees in an empty square. So my question is the following one : can I search the spatial pattern of points IN a limited area which has a complex shape ?

I hope I am clear, but do not hesitate to ask me questions.

Ellimac
  • 11
  • 1
  • Sounds like your observation window (region where trees have been surveyed) is a complex polygonal shape which you need to inform spatstat about in the call to ppp. Do you have the region in some standard format like shapefile or whatever? – Ege Rubak Mar 30 '18 at 09:06
  • Hey, thanks for your answer, I think you understood well the problem ! I have a shapefile containing all parcels (and 1 parcel = 1 polygon). But sometimes there are huge space between parcels, so the shapefile contains discontinues polygons. Can I use a disontinues layer of polygons in the PPP ranges ? – Ellimac Mar 30 '18 at 14:24
  • Yes you can use very general polygonal regions. Look at the help file and examples of owin() – Ege Rubak Mar 30 '18 at 22:41

1 Answers1

0

Since this question has been viewed many times, here is a detailed answer.

The analysis of a point pattern should always take account of the spatial region where points could have occurred. The spatstat package is designed to support this.

Point patterns are represented by objects of class ppp. The spatial region ("window") can be any complicated shape, or shapes, represented by an object of class owin.

You can create a point pattern in an irregularly-shaped window by

A <- ppp(x, y, window=W)

where x and y are vectors of coordinates, and W is a spatial region object of class owin created by the function owin. The object W can be a polygon, or several disconnected polygons, or a binary pixel mask, etc.

By the way, we strongly discourage the use of syntax like

PPP <- ppp(x, y, xrange = range(x), yrange = range(y))

because even when the spatial region is known to be a rectangle, it is unwise to estimate the limits of the rectangle by using the ranges of the coordinates.

For more information, see the spatstat book.

Adrian Baddeley
  • 2,534
  • 1
  • 5
  • 8