0

Hi? I have a data of seedlings distribution which contains species types, X and Y coordinates in UTM. I want to create a point pattern by their X & Y coordinate location with the help of ppp() function in spatstat package. I tried it with following 2 ways:

 p.patt <- ppp(mydata$X, mydata$Y)
 p.patt <- ppp(mydata$X, mydata$Y, owin(c(100,131), c(100,130)))

But there is a “Warning message: 435 points were rejected as lying outside the specified window” for both of them.

I guess this is related to ranges of X and Y coordinates that should be specified in this code in c(…), c(…). I checked the range of X &Y and R gave me following ranges:

for X: 368615 and 368746, 
for Y: 4587355 and 4587485 

When I plot the data, a shape of the plot looks like "tilted rombo". I don't know if it is help.

Here I have just randomly chosen tried some numbers: 100 & 131 & 130. I couldn’t find any information how to set them online.

So my question is how I can use these ranges of coordinates to set observation window geometry of point patterm in spatstat package in R?.

Thank you very much in advance!

markalex
  • 8,623
  • 2
  • 7
  • 32
R starter
  • 197
  • 12

2 Answers2

0

Don't you have information about the plot? E.g. the coordinates of the corners of a polygonal region delimiting the plot? If you have these coordinates use them as input in the argument poly of owin. See the help file for owin for details. In lack of any information you can try ripras to estimate the boundary of the plot.

What you do right now is to say that you define a point pattern in the rectangle [0,131]×[0,130] and then you provide a bunch of points with coordinates outside this area (much larger coordinate values) and they are all discarded.

Ege Rubak
  • 4,347
  • 1
  • 10
  • 18
  • @ Ege Rubak. Unfortunately I don't have info about them. Can you tell me what is the most important thing to consider to set it? – R starter Feb 26 '19 at 20:28
0

The numbers in the owin call are not the width and height of the window; they are the X and Y coordinates of the corners of the window.

Since the range of X coordinate values of the data points is from 368615 to 368746, the window needs to contain this range, at least. Similarly the range of Y values must be contained in the window. The minimal window that will not give a warning is

p.patt <- ppp(mydata$X, mydata$Y, owin(c(368615,368746), c(4587355,4587485)))

or equivalently

p.patt <- ppp(mydata$X, mydata$Y, c(368615,368746), c(4587355,4587485))

But this is just the minimal window that is acceptable; for a proper analysis, you need information about the survey region. If it is not a rectangle then, as Ege says, you need to specify owin(poly=...) using the coordinate locations of the vertices of the polygon.

Adrian Baddeley
  • 2,534
  • 1
  • 5
  • 8
  • it works well. Now I got it. I'll consider Edge and your suggestion about corners of survey region. Thank you very much for both of you! – R starter Feb 27 '19 at 10:25