# [R-sig-Geo] [FORGED] how to calculate centroid (or centre of gravity) of a population (count data)

Rolf Turner r.turner at auckland.ac.nz
Wed Apr 20 12:00:34 CEST 2016

```Maybe I'm being naive, or missing the point, or something.  But I would
presume that your data are something like:

x_1, x_2, ..., x_n # x-coordinates of the locations --- say, stored as x
y_1, y_2, ..., y_n # y-coordinates of the locations --- say, stored as y
k_1, k_2, ..., k_n # counts at the given locations --- say, stored as k

This is interpreted as meaning that (x_i,y_i) is the centroid of the
i-th region, in which count k_i was obtained.

If so, can you not just calculate:

xc <- sum(k*x)/sum(k)
yc <- sum(k*y)/sum(k)

???

What am I not understanding?

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

On 20/04/16 18:45, Diego Pavon wrote:
> Dear all
>
> I am working with count data and I want to assess whether the centre of
> gravity of the population (centroid or mean latitude?) has change over
> time, indicating some redistribution or shift ongoing. To simplify, let's
> say that I have ca. 2000 sites censused in two consecutive years (same
> sites censused both years - all sites) and the abundance (count) of the
> species registered.
>
> apparently this only takes into account the location of the sites to
> calculate the kernel and then the centroids. Thus, since I have the exact
> same sites in both years, the centroids for year 1 and year 2 are the same.
> In my case, what I would like to do is to calculate that centroid but
> taking into account the counts, because a site that had 3 individuals in
> both years can't have the same weight than a site that hosted 3000
> individuals when calculating the centroids.
>
> So, what I would like to have is the centroid (or centre of gravity) of the
> counts not of the sites surveyed (which is what adehabitatHR does,a s far
> as I understood).
>
> Do you have any suggestions which package other than adehabitatXX to use
> for this purpose? Or if this can be done with adehabitat?
>
> Thank you very much for your help.

```