# Create points pattern in R using spatstat package with specified number of points

Is it possible to generate points pattern with Poisson and Thomas process in R using spatstat package with specified number of points? I had genereted Strauss point pattern using the Metropolis-Hastings algorithm with specified number of points (20 points) like this:

Model <- list(cif="straush",par=list(beta=10,gamma=0.5,r=0.5,hc=0.5),
w=c(0,10,0,10))
P <- rmh(model=Model,start=list(n.start=20),
control=list(p=1,nrep=1e5,nverb=5000))


but I can not generate Poisson or Thomas point pattern using the Metropolis-Hastings algorithm.

A Poisson process conditional on the number of points is just a collection of independent and identically distributed points with density proportional to the intensity, so you can use the spatstat function rpoint to simulate that process.