[R-sig-Geo] unexpected behavior from rpcp function in stpp

Seth Flaxman flaxman at gmail.com
Tue Feb 19 04:23:39 CET 2013


Hi list. Am I missing something obvious here? Should the dispersion
flip the relative number of parents and children? Or maybe I'm
misinterpreting the rownames?

# -- sample code --

library(stpp)
set.seed(1)
pp1 <- rpcp(nparents=40, mc=5, cluster=c("normal"),dispersion=.4)

# I expect 40*5 = 200 points total, 40 parents (marked with "") and
40*4=160 children (marked with "x")

table(rownames(pp1$xyt))
# result makes sense:
#      x
# 54 153

pp2 <- rpcp(nparents=40, mc=5, cluster=c("normal"),dispersion=.05)
# I expect the same thing, but for some reason the number of parents
and the number of children are switched

table(rownames(pp2$xyt))
# result doesn't make sense:
#      x
# 143  59

Thanks,
Seth



More information about the R-sig-Geo mailing list