[R-sig-Geo] Does spatstat round the frequency results?

Zev Ross zev at zevross.com
Thu Aug 13 16:57:55 CEST 2009


Hi All,

I was puzzled when the mark frequency table from the summary of a 
spatstat PPP object did not match the actual count of marks. The 
mismatch was small but unmistakable. After wasting time testing if this 
was related to duplicates or an odd window specification it seems that 
the reason is far simpler -- it seems that the summary.ppp class rounds 
the frequencies for objects with a large number of observations (see 
below for the example).

Is this true? Is there a reason for this?

Zev


mywin<-owin(c(-126,-111), c(28,46))

randData<-rpoispp(10, win=mywin)
marks(randData)<-factor(paste("Level", sample(1:8,
    length(randData$x), replace=TRUE)))

# here the summary table does match the number of marks

length(randData$marks)
table(randData$marks)
summary(randData)
summary(randData)$marks$frequency

###############################################

mywin<-owin(c(-126,-111), c(28,46))

randData<-rpoispp(50, win=mywin)
marks(randData)<-factor(paste("Level", sample(1:8,
    length(randData$x), replace=TRUE)))

# here the summary table does NOT match the number of marks

length(randData$marks)
table(randData$marks)
summary(randData)
summary(randData)$marks$frequency



-- 
Zev Ross
ZevRoss Spatial Analysis
120 N Aurora, Suite 3A
Ithaca, NY 14850
607-277-0004 (phone)
866-877-3690 (fax, toll-free)
zev at zevross.com



More information about the R-sig-Geo mailing list