I have a list containing n x 3 matrices. WHere the first column are the X-Coords, the second column is the Y- Coords and the third column is a value ( 1's and 0's). how do iterate through this list to output a list of spatial patterns.
I have tried converting it straight using as.ppp and a generic rectangular window. However, the output is infinite points, instead of just the locations of 1's
Here is an example of one the matrices in the list: x-coord y-coord value [1,] 1 301 0 [2,] 1 302 0 [3,] 2 302 1 [4,] 1 303 0 [5,] 2 303 0 [6,] 3 303 0 [7,] 1 304 0 [8,] 2 304 0 [9,] 3 304 0
enter code here
```r
ww <- owin(c(0,640), c(0,640))
x=lapply(matrix,function(matrix) {as.ppp(matrix,ww)})