[R] Quadrat counting with spatstat
Oliver Ruebenacker
curoli at gmail.com
Thu May 31 20:50:39 CEST 2012
Hello,
There is more than one way to do it. I would divide space according
to weighted distance.
Specify a distance function. Euclidian distance will give you
boundaries that consist of ellipse segments. Manhattan distance will
give you straight lines which may be preferable.
Assign to every circle i a distance weight wd[i]. You can start with
equal weights.
Associate every point j in space with the circle i to which it has
the smallest weighted distance distance(i,j)/wd[i]. This will divide
space into segments, each containing one circle.
Use a set of points equally distributed over space (e.g. grid points
or random) and calculate how segments area sizes relate to each other
by counting how many points fall into each segment.
Adjust distance weights - the larger the distance weight, the larger
the area around the circle - until the areas are equal enough for your
purpose. Exploit symmetries by keeping distance weights equal that
should be equal due to symmetry.
You can run an optimization algorithm by using an evaluation
function that is minimal for equal areas.
Hope this helps!
Take care
Oliver
On Thu, May 31, 2012 at 11:23 AM, AMFTom <the.quiet.room at gmail.com> wrote:
> I have photographs of plots that look like so:
>
> http://r.789695.n4.nabble.com/file/n4631960/Untitled.jpg
>
> I need to divide it up so each circle has an equal area surrounding it. So
> into 20 equal segments, each of which contains a circle. Quadratcount is not
> sufficient because if I divide it up into 36 equal quadrats, some quadrats
> do not contain one of the circles.
>
> I'm not even sure how to do it mathematically, let alone using R.
>
> Can anyone help?
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Quadrat-counting-with-spatstat-tp4631960.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Oliver Ruebenacker
Bioinformatics Consultant (http://www.knowomics.com/wiki/Oliver_Ruebenacker)
Knowomics, The Bioinformatics Network (http://www.knowomics.com)
SBPAX: Turning Bio Knowledge into Math Models (http://www.sbpax.org)
More information about the R-help
mailing list