[AniMov] Adehabitat: creating MCPs every two weeks for 32 different animals

Damiano G. Preatoni prea at uninsubria.it
Fri Jun 4 08:15:00 CEST 2010


In un messaggio del Thursday 03 June 2010, Clément Calenge ha scritto:
> >So, I have three questions: is it only a date format issue or am I missing
> >something else? If it is a date format issue, then, >how would it be
> >possible to convert my dates in “YYyy-mm-dd” into “yymmdd”? and finally
> >what loop functions or steps > could I take to create MCPs for the
> >animals every two weeks.
> 
> The error is not a date format issue, as the date is not required for the
> calculation of the mcp. As the error message indicates, you need five
> relocations or more to compute a minimum convex polygon. That is, if you
> type:
> 
> any(table(all.id)<5)
> 
> If it returns TRUE, this means that for some animals, you have less than 5
> relocations, and so you cannot compute a MCP. To identify the animals that
> are characterized by 5 relocations or more, try:
> 
> ta <- table(all.id)<5
> ta[ta<5]
> 
> And so, you can remove these animals, if you want to calculate a MCP for
> each one:
> 
> out <- names(ta[ta<5])
> pc <- mcp(all.xy[!(all.id%in%out),], factor(all.id[!(all.id%in%out)])
> plot(pc)
> 
> Now concerning the loop every two weeks, it is hard to describe you what to
> do without any data or precision on what you expect exactly... What are
> the limits of the "pairs of weeks"? are they the same for all animals? are
> you able to build a variable indicating the id of the "pairs of weeks" for
> each relocation (e.g. "2007-09-04" is in the "pair" 1, etc.)? We need more
> details... HTH,

Hi Abdi, list
we made something similar to calculate "sesaonal" (see below) kernels for 
snowshoe hare.

As Clément pointed out, the main issue is not "technical" (I mean, on the R 
side), but biological.
Your "two weeks" timespan are probably not determined just on the base of a 
date but are in some way individual-dependant.

Anyway, once you've determined the _exact_ date ranges that define each time 
interval (per animal or not) you can create a new column in your dataframe 
pasting together animal ID and a "fortnight ID". Using that new column as 
animal ID, any adehabitat homerange calculation can be done.

Just to give the idea: for snowshoe hare we defined "sesaons" on an annual 
biological cycle basis (moult, breeding season, summer, winter moult, winter, 
etc), and then recoded (car::recode is rather handy here) a new variable 
called "period" (numbered from 1 to 5). The new ID was then assembled using 
animal ID and period, so that kernelUD was used to calculate separate home 
ranger per animal _and_ period.

Again, problem is how those "two weeks" are defined.

If you're interested in a detailed example I can dig out the script from our 
archive.

HTH


-- 
"Microwave oven?  Whaddya mean, it's a microwave oven?  I've been watching
Channel 4 on the thing for two weeks."
-----------------------------------------------------------
Damiano G. Preatoni, PhD

Unità di Analisi e Gestione delle Risorse Ambientali
Dipartimento Ambiente-Salute-Sicurezza
Università degli Studi dell'Insubria
Via J.H. Dunant, 3 - 21100 Varese (ITALY)

tel +39 0332421538 fax +39 0332421446
http://biocenosi.dipbsf.uninsubria.it/
ICQ: 78690321 jabber: prea at jabber.org skype: prea.net
-----------------------------------------------------------
Please consider the environment before printing this email
Please do not send attachments in proprietary formats
http://www.gnu.org/philosophy/no-word-attachments.html
Use the UNI CEI Standard ISO/IEC 26300:2006
-----------------------------------------------------------
O< stop html mail - http://www.asciiribbon.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.faunalia.it/pipermail/animov/attachments/20100604/e11980c1/attachment.pgp>


More information about the AniMov mailing list