KernelUD image scale bar

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

KernelUD image scale bar

Lutfor
Dear members,

I have been trying to give scale bar on kernel contour map using adehabitatHR package. But I could not find any function to put scale bar onto the image produce.

Any help would be much appreciated.

Regards
Lutfor
UK  
Reply | Threaded
Open this post in threaded view
|

Re: KernelUD image scale bar

Mathieu Basille-3
Dear Lutfor,

Following the example of ?kernelUD:

## Load the package
library(adehabitatHR)

## Load the data
data(puechabonsp)
loc <- puechabonsp$relocs

## Estimation of UD for the four animals
(ud <- kernelUD(loc[,1]))

## The UD of the four animals
image(ud)

## First one with a scale
spplot(ud[[1]])

Then you'd be able to adjust it using spplot options (I'm not a specialist
of this, I just know it can be fairly complex). The reason it works is that
kernelUD produces an object of class estUDm, which is a list with one estUD
object per animal. An estUD object itself inherits from the class
SpatialPixelsDataFrame. As a result, every function that works on a spdf
would work on an estUD too.

Things will get a little bit trickier if you want all kernels on the same
scale. That's where you need to use the argument 'same4all = TRUE':

## Recompute the UD with the same grid for all animals
(ud2 <- kernelUD(loc[,1], same4all = TRUE))

## Convert it to a regular spdf
ud2 <- estUDm2spixdf(ud2)

## And plot
spplot(ud2)

Voilà !

Hope this helps,
Mathieu.


Le 09/27/2013 05:44 PM, Lutfor a écrit :

> Dear members,
>
> I have been trying to give scale bar on kernel contour map using
> adehabitatHR package. But I could not find any function to put scale bar
> onto the image produce.
>
> Any help would be much appreciated.
>
> Regards
> Lutfor
> UK
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/KernelUD-image-scale-bar-tp7584738.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--

~$ whoami
Mathieu Basille, PhD

~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314
http://ase-research.org/basille

~$ fortune
« Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. »
  -- Paul Éluard

_______________________________________________
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: KernelUD image scale bar

Lutfor
Dear Mathieu,

Thank you very much for your kind help.
That's really help me.
However, I would like create contour map as shown in the image (which I managed to do). Here, I would like to put scale bar onto the image to show what are distance between points.



Contour map


Would it be possible to help me in this regard.

Kind regards
Lutfor
Reply | Threaded
Open this post in threaded view
|

Re: KernelUD image scale bar

Mathieu Basille-3
Maybe have a look at the sp.layout argument, together with the key.space
argument. For example:

http://rspatial.r-forge.r-project.org/gallery/#fig03.R

But I'm definitely no sp expert... Not sure I can help more than that.
Mathieu.


Le 10/11/2013 09:33 AM, Lutfor a écrit :

> Dear Mathieu,
>
> Thank you very much for your kind help.
> That's really help me.
> However, I would like create contour map as shown in the image (which I
> managed to do). Here, I would like to put scale bar onto the image to show
> what are distance between points.
>
>
>
> <http://r-sig-geo.2731867.n2.nabble.com/file/n7584838/Contour_Map.jpg>
>
>
> Would it be possible to help me in this regard.
>
> Kind regards
> Lutfor
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/KernelUD-image-scale-bar-tp7584738p7584838.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--

~$ whoami
Mathieu Basille, PhD

~$ locate --details
University of Florida \\
Fort Lauderdale Research and Education Center
(+1) 954-577-6314
http://ase-research.org/basille

~$ fortune
« Le tout est de tout dire, et je manque de mots
Et je manque de temps, et je manque d'audace. »
  -- Paul Éluard

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