Hi all, I am using quadratcount in spatstat to divide a window containing a point pattern into a grid of quadrats containing the intensity of points in each quadrat. My data is in UTM co-ordinates. My window is defined as follows:>p15<-ppp(x,y,window=owin(c(341710,342100),c(3126465,3126780)),marks=NULL, checks=TRUE) Giving me a distance of 390m in the 'x' direction and 315m in the 'y' direction. I want to divide the window into quadrats of size 15m x 15m so I did the following:>q15<-quadratcount(p15,nx=26,ny=21).However, when I look at the data for quadrat counts it seems the function is not keeping the size of the quadrats constant, but is instead varying the width of the quadrats (in both the x and y direction) between 10m and 20m, meaning that some quadrats are 10m x 10m and some are four times the size (20m x 20m) (I have pasted some of the output below to demonstrate). This is quite concerning as I am trying to ascertain the scale of variation in my point pattern density - I cannot do this if the quadrat scale does not stay constant!! Does anyone know how to make quadratcount produce equally sized quadrats? Many thanks Lauren ymin 3126470 3126480 3126500 3126510 3126530 ymax 3126480 3126500 3126510 3126530 3126540 xmin xmax 341710 341720 0 1 0 0 0 341720 341740 0 0 3 1 5 341740 341750 0 1 2 1 3 341750 341770 2 1 0 0 1 341770 341780 4 6 5 4 0 341780 341800 1 4 2 1 1 341800 341810 0 0 1 5 1 341810 341830 0 0 0 1 3 341830 341840 4 1 3 0 0 341840 341860 1 1 0 0 2 341860 341880 4 2 0 0 3 341880 341890 3 2 0 5 1 341890 341900 3 2 0 4 1 341900 341920 3 2 2 0 0 341920 341930 0 3 2 3 0 341930 341950 1 5 2 2 4 341950 341960 0 0 6 3 2 341960 341980 0 0 0 3 2 341980 341990 0 0 0 0 0 341990 342010 0 0 3 0 0 342010 342020 1 0 0 0 0 342020 342040 1 1 1 1 2 342040 342050 1 0 0 0 2 342050 342070 1 0 0 0 0 342070 342080 1 0 0 0 0 342080 342100 0 0 0 0 0 This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
Gough, Lauren wrote:> >> I am using quadratcount in spatstat to divide a window containing a >> point pattern into a grid of quadrats containing the intensity of >> points in each quadrat.>> However, when I look at the data for quadrat counts it seems the >> function is not keeping the size of the quadrats constant, but is >> instead varying the width of the quadrats (in both the x and y >> direction) between 10m and 20m, meaning that some quadrats are 10m x >> 10m and some are four times the size (20m x 20m) (I have pasted some >> of the output below to demonstrate).This isn't exactly the pasted output from spatstat, is it? The output from spatstat for this window would look something like this: x y [3.4171e+05,3.4172e+05] (3.4172e+05,3.4174e+05] (3.12676e+06,3.12678e+06] 1 0 (3.12675e+06,3.12676e+06] 0 2 (3.12674e+06,3.12675e+06] 0 0 and so on. The row and column labels indicate the boundaries of the quadrats; however, because the coordinates are large numbers, they have been formatted in scientific notation, and ROUNDED to the fourth or fifth decimal place. A number printed as 3.12675e+06 is not always exactly equal to 3126750. It could be anywhere from 3126745 to 3126755. The peculiar impression that the successive differences alternate between 10 and 20, when they should be 15, is an artefact of the rules used for rounding numbers in R. To extract the precise values of the quadrat boundaries, use xbreaks <- attr(q15, "xbreaks") ybreaks <- attr(q15, "ybreaks") Then you can check directly that the breaks are evenly spaced at intervals of 15 units in each direction. Incidentally, please be warned that there is a bug in the plot method plot.quadratcount in spatstat 1.14-4 which causes the counts to be plotted in the wrong quadrats. This will be fixed in the next release spatstat 1.14-5, due shortly. Adrian Baddeley