I was wondering if the marks command inside the spatstat package could be used with categorical variables instead of continous ones. I have an xlsx table (A2N) with three columns: Size (categoric), CoordX(numeric) and CoordY(numeric).
Here is the script I´m using:
attach(A2N)
MPN2 <- ppp(CoordX, CoordY, c(621470,623141), c(9412006,9414455))
plot(MPN2)
marks(MPN2) <- A2N[, c("Size")]
plot(Smooth(MPN2))
And this is the message that comes up:
> plot(Smooth(MPN2))
Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] :
non-numeric argument to binary operator
In addition: Warning messages:
1: some mark values are NA in the point pattern X
2: some mark values are NA in the point pattern X
3: some mark values are NA in the point pattern X