Quantcast

Fwd: adehabitatHR and kernelUD problems estimating home range size

classic Classic list List threaded Threaded
3 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: adehabitatHR and kernelUD problems estimating home range size

Isabella Mandl
Dear all, I apologise for this simplistic question - it might be very easy
and straightforward to solve...? (I hope.)

I've been trying to estimate home range size and UD through both the mcp()
and the kernelUD() functions from the package adehabitatHR. I have done
these calculations before, without a problem, but this time there seems to
be a hiccup I can't figure out.

I have fourteen individual animals, each with its own set of GPS points
from which I want to calculate the home range size (and subsequently
overlap). However, the home range size (when computed via getverticeshr,
kernel.area and mcp) comes back as ridiculously small.

Variables measured:
  id         area
1  1 1.095734e-10
2  2 3.917295e-11
3  3 3.956386e-11
4  4 1.176246e-10
5  5 3.675360e-11
6  6 3.402833e-11
...

I've checked the units and this is the size expressed in hectares. The
normal sizes of these home ranges are between 0.5 and 1.5 hectares. If the
same GPS points are plotted in a GIS programme they look fine size-wise,
why does R not calculate them correctly? What am I overlooking/doing wrong?

The data seems to me to be read correctly as a SpatialPointsDataFrame, the
CRS is set correctly, I can plot the points and the outlines. It's just the
sizes that are messed up.

> str(coords)
Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
  ..@ data       :'data.frame':    4423 obs. of  2 variables:
  .. ..$ Individual: Factor w/ 14 levels "1","2","3","4",..: 1 1 1 1 1 1 1
1 1 1 ...
  .. ..$ Season    : Factor w/ 2 levels "DRY","WET": 1 1 1 1 1 1 1 1 1 1 ...
  ..@ coords.nrs : int [1:2] 4 3
  ..@ coords     : num [1:4423, 1:2] 47.8 47.8 47.8 47.8 47.8 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:2] "Easting" "Southing"
  ..@ bbox       : num [1:2, 1:2] 47.8 -14.4 47.8 -14.4
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : chr [1:2] "Easting" "Southing"
  .. .. ..$ : chr [1:2] "min" "max"
  ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
  .. .. ..@ projargs: chr "+init=EPSG:32638 +proj=utm +zone=38 +datum=WGS84
+units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"

Maybe one of you had a similar issue and can point something out to me?
Thankful for any help!
Isabella

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: adehabitatHR and kernelUD problems estimating home range size

Clement Calenge
Dear Isabella,

I do not have the data, but it seems that there is a problem with your
object coords:

>> str(coords)
> Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
>    ..@ data       :'data.frame':    4423 obs. of  2 variables:
>    .. ..$ Individual: Factor w/ 14 levels "1","2","3","4",..: 1 1 1 1 1 1 1
> 1 1 1 ...
>    .. ..$ Season    : Factor w/ 2 levels "DRY","WET": 1 1 1 1 1 1 1 1 1 1 ...
>    ..@ coords.nrs : int [1:2] 4 3
>    ..@ coords     : num [1:4423, 1:2] 47.8 47.8 47.8 47.8 47.8 ...
>    .. ..- attr(*, "dimnames")=List of 2
>    .. .. ..$ : NULL
>    .. .. ..$ : chr [1:2] "Easting" "Southing"
>    ..@ bbox       : num [1:2, 1:2] 47.8 -14.4 47.8 -14.4
>    .. ..- attr(*, "dimnames")=List of 2
>    .. .. ..$ : chr [1:2] "Easting" "Southing"
>    .. .. ..$ : chr [1:2] "min" "max"
>    ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
>    .. .. ..@ projargs: chr "+init=EPSG:32638 +proj=utm +zone=38 +datum=WGS84
> +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"

Note that the slot @bbox indicates that all the points are located at
the same place: xmin=xmax=47.8; ymin=ymax=-14.4. Similarly, the slot
@coords indicate the same coordinates for all points (47.8, 47.8, etc.).
Are you sure that you set your CRS correctly? My guess is that you have
your coordinates in Latitude/Longitude, and that you defined the
proj4string slot without projecting your data, i.e. you used :

proj4string(coords) <- CRS("+init=EPSG:32638")

instead of

proj4string(coords) <- CRS("+init=EPSG:4326")
coords <- spTransform(coords, CRS("+init=EPSG:32638"))

However, this is just a guess.
HTH,

Clément Calenge


--
Clément CALENGE
Ingénieur Expert -- Biométricien
Cellule d'appui méthodologique
Direction de la Recherche et de l'Expertise
Office national de la chasse et de la faune sauvage
Saint Benoist - 78610 Auffargis
tel. (33) 01.30.46.54.14

_______________________________________________
R-sig-ecology mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: adehabitatHR and kernelUD problems estimating home range size

Isabella Mandl
SOLVED

Dear Clément,
thank you, that really did the trick! I had simply not projected the data!

Perfect!
All the best,
Isabella

On 21 January 2017 at 16:09, Calenge Clement <[hidden email]>
wrote:

> Dear Isabella,
>
> I do not have the data, but it seems that there is a problem with your
> object coords:
>
> >> str(coords)
> > Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots
> >    ..@ data       :'data.frame':    4423 obs. of  2 variables:
> >    .. ..$ Individual: Factor w/ 14 levels "1","2","3","4",..: 1 1 1 1 1
> 1 1
> > 1 1 1 ...
> >    .. ..$ Season    : Factor w/ 2 levels "DRY","WET": 1 1 1 1 1 1 1 1 1
> 1 ...
> >    ..@ coords.nrs : int [1:2] 4 3
> >    ..@ coords     : num [1:4423, 1:2] 47.8 47.8 47.8 47.8 47.8 ...
> >    .. ..- attr(*, "dimnames")=List of 2
> >    .. .. ..$ : NULL
> >    .. .. ..$ : chr [1:2] "Easting" "Southing"
> >    ..@ bbox       : num [1:2, 1:2] 47.8 -14.4 47.8 -14.4
> >    .. ..- attr(*, "dimnames")=List of 2
> >    .. .. ..$ : chr [1:2] "Easting" "Southing"
> >    .. .. ..$ : chr [1:2] "min" "max"
> >    ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
> >    .. .. ..@ projargs: chr "+init=EPSG:32638 +proj=utm +zone=38
> +datum=WGS84
> > +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"
>
> Note that the slot @bbox indicates that all the points are located at
> the same place: xmin=xmax=47.8; ymin=ymax=-14.4. Similarly, the slot
> @coords indicate the same coordinates for all points (47.8, 47.8, etc.).
> Are you sure that you set your CRS correctly? My guess is that you have
> your coordinates in Latitude/Longitude, and that you defined the
> proj4string slot without projecting your data, i.e. you used :
>
> proj4string(coords) <- CRS("+init=EPSG:32638")
>
> instead of
>
> proj4string(coords) <- CRS("+init=EPSG:4326")
> coords <- spTransform(coords, CRS("+init=EPSG:32638"))
>
> However, this is just a guess.
> HTH,
>
> Clément Calenge
>
>
> --
> Clément CALENGE
> Ingénieur Expert -- Biométricien
> Cellule d'appui méthodologique
> Direction de la Recherche et de l'Expertise
> Office national de la chasse et de la faune sauvage
> Saint Benoist - 78610 Auffargis
> tel. (33) 01.30.46.54.14
>

        [[alternative HTML version deleted]]

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