Skip to content
Prev 4342 / 29559 Next

Create/convert a point pattern from raw txt file in spatstat?

Hi all,

I'm new to R, so I'm still learning how to do this: I have a txt file  
that contains X Y coordinate of trees (range from 0-100 for both X and  
Y) and a "mark" column that's the tree ID. The total is about 600  
lines. Part of the data looks like:

X	Y	Mark
1	94	1
2.5	94.5	4
3	93	5
4	92	6
4	95	7
6	98	8
4	84	9
6	86	10
6	86	11
6	86	12
6	86	13
8	88	14
9.5	89.5	15
10	90	16

In order to create a point pattern, should I used scanpp, ppp, or  
as.ppp?Here's the error I get for each command:
Error: is.numeric(x) is not TRUE
Error in ppp(x, y, xrange = c(0, 100), yrange = c(0, 100), marks,  
check = TRUE) : object "x" not found
Error in verifyclass(window, "owin") : argument ?window? is not of  
class ?owin?
Error: is.numeric(x) is not TRUE

My problems are not knowing which command to use and how the "window"  
should be specified. Can anyone help me with this? Thanks so much!

Ophelia