0
votes

I am using spatstat in R to generate points on a linear network. I had successfully generated a poisson distributed poisson process on a road network.

Now when I want to use the 'nsim', to have more than one realization of the random process, I get an error (using this data) http://biogeo.ucdavis.edu/data/diva/rds/NLD_rds.zip

roads<-readShapeSpatial("NL_rd.shp")
spatstat.roads<-as.psp(roads)
final_roads<-as.linnet(spatstat.roads)

abc<-rpoislpp(0.02/5000,final_roads, nsim=2)
plot(abc)

when I use that nsim, I get an error as follows

Error in (function (..., check = TRUE, promote = TRUE, demote = FALSE)  : 
  Some arguments of solist() are not 2D spatial objects

While it works for one realization, i wanted to draw two realizations to visually compare the randomness. So i not understand how one realization can be arrived but not two and the error talks of non-2D spatial objects. it is a little cryptic for me.

Could you please clarify on this error and how to resolve it.

Thanks.

1

1 Answers

1
votes

This is a bug.

It will be fixed shortly in the development version of spatstat, version 1.47-0.018 and later.

In the meantime you can get the desired result by using replicate, e.g.

abc <- replicate(2, rpoislpp(0.02/5000,final_roads), simplify=FALSE)

Thank you for drawing this to our attention.