[R-sig-eco] include Time in as.ltraj()

Struve, Juliane j.struve at imperial.ac.uk
Mon Jun 15 12:22:48 CEST 2009


Dear Clement,

thank you very much for replying.

All_1646_ltrj <- as.ltraj(All_1646_test[,1:2], date=All_1646_test$Date, id=All_1646_test$Fish_ID, typeII = TRUE)

works fine, All_1646_test[,1:2] now contains the coordinates that as.ltraj() is looking for. 


However, I still get an error meassage with regards to non-unique observations. Actually, the observations vary by seconds, but it seems these small differences are not recognized ?  If I change the times manually so that the observations differ by an hour the above statement works fine. Short time intervals of a few seconds are a characteristic of my data. How can I deal with such data ? 

Many thanks for your advice and best wishes,

Juliane 


________________________________________
From: clement.calenge at oncfs.gouv.fr [clement.calenge at oncfs.gouv.fr]
Sent: 12 June 2009 09:22All_1646_ltrj <- as.ltraj(All_1646_test[,1:2], date=All_1646_test$Date, id=All_1646_test$Fish_ID, typeII = TRUE)
To: Struve, Juliane
Cc: r-sig-ecology at r-project.org
Subject: Re: [R-sig-eco] include Time in as.ltraj()

 > ltr1646 <-as.ltraj(All_1646, date=All_1646$Datime,
 > id=All_1646$"Fish_ID", typeII = TRUE)
 >
 > I get an error message
 > "Error in as.ltraj(All_1646, date = All_1646$Datime, id =
 >  All_1646$Fish_ID,  : non unique dates for a given burst".
 >
 > However, the Datime column does include the time of observation as
 > shown below. What am I doing wrong ?


Hard to say without any reproducible example...
However, it seems that there are several errors in your code and data:
first, note that the first argument of the function (xy) should be a
data frame containing only the coordinates of the relocations of the
animal (presently, it also contains the date, the time, a column named
Datime, etc.). Please check that your arguments are correct.

Now, concerning your message, it is likely that several relocations
have been collected at exactly the same moment (i.e. for a given
Fish_ID, there are probably at least two relocations with the same
value of Datime). You can verify it:

ta <- table(All_1646$Fish_ID, All_1646$Datime)
any(ta>1)

look at this table: if there is any value >1, this means that there
are probably two relocations collected at the same date for a given
animal.
HTH,


Clément Calenge.
--
Clément CALENGE
Office national de la chasse et de la faune sauvage
Saint Benoist - 78610 Auffargis
tel. (33) 01.30.46.54.14


More information about the R-sig-ecology mailing list