Extract all point in a quadrats by spatstat package

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Extract all point in a quadrats by spatstat package

R-sig-geo mailing list
Hi,

With the following code i can divides window into quadrats and counts the numbers of points in each quadrat.

library(spatstat)
X <- runifpoint(50)
quadratcount(X)
quadratcount(X, 4, 5)
quadratcount(X, xbreaks=c(0, 0.3, 1), ybreaks=c(0, 0.4, 0.8, 1))
qX <-  quadratcount(X, 4, 5)
plot(X)
plot(qX, add=TRUE)

But I want to mark each  quadrats  and select/ extract only those points by selecting quadrats id . 
Can anyone plese help me regarding this issue ?
Thanks in advance .



Regards.............
Tanvir Ahamed
Stockholm, Sweden     |  [hidden email]  
        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Extract all point in a quadrats by spatstat package

Marcelino de la Cruz Rot
Maybe

cut(X, as.tess(qX))

or

split.ppp(X, as.tess(qX))

?
Cheers,

Marcelino



El 28/11/2017 a las 16:37, Mohammad Tanvir Ahamed via R-sig-Geo escribió:

> Hi,
>
> With the following code i can divides window into quadrats and counts the numbers of points in each quadrat.
>
> library(spatstat)
> X <- runifpoint(50)
> quadratcount(X)
> quadratcount(X, 4, 5)
> quadratcount(X, xbreaks=c(0, 0.3, 1), ybreaks=c(0, 0.4, 0.8, 1))
> qX <-  quadratcount(X, 4, 5)
> plot(X)
> plot(qX, add=TRUE)
>
> But I want to mark each  quadrats  and select/ extract only those points by selecting quadrats id .
> Can anyone plese help me regarding this issue ?
> Thanks in advance .
>
>
>
> Regards.............
> Tanvir Ahamed
> Stockholm, Sweden     |  [hidden email]
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Marcelino de la Cruz Rot
Depto. de Biología y Geología
Física y Química Inorgánica
Universidad Rey Juan Carlos
Móstoles España

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo