[R-sig-eco] Adehabitat Ltraj error message: "non unique dates for a given burst"

basille.web at ase-research.org basille.web at ase-research.org
Wed Nov 20 15:09:59 CET 2013


Hi Nick,

You can try:

sum(duplicated(paste(da, march2012df$ID)))

and from there, if the sum is > 0, identify the duplicates *per individual*.

As far as I can tell, the function as.ltraj works at the burst level, in 
your cases individuals.

Mathieu.


Le 11/20/2013 07:21 AM, Nick van Doormaal a écrit :
> Hello everyone,
>
> I'm trying to create a ltraj-class.
> I start with importing an excel file containing all the relocations (in this case for the month March) into ArcMap and create a shapefile. Next I load the shapefile into R and transform the coordinates to UTM37S.
>
> My dataset looks as follows:
>
> head(march2012)
>   coordinates                           ID                                       Date_old        Longitude   Latitude           Date
> 0 (496297, 9688770)  Emusaya_Male  2012-03-20   38.96668   -2.815783  2012-03-20 00:04
> 1 (496670, 9686680)  Emusaya_Male  2012-03-20   38.97003   -2.834650  2012-03-20 01:04
> 2 (497136, 9685230)  Emusaya_Male  2012-03-20   38.97423   -2.847833  2012-03-20 02:04
> 3 (497233, 9684700)  Emusaya_Male  2012-03-20   38.97510   -2.852633  2012-03-20 03:05
> 4 (497105, 9684290)  Emusaya_Male  2012-03-20   38.97395   -2.856317  2012-03-20 04:04
> 5 (497281, 9683830)  Emusaya_Male  2012-03-20   38.97553   -2.860467  2012-03-20 05:04
>
> I used the following script:
> da <- as.character(march2012$Date)
> da <- as.POSIXct(strptime(as.character(march2012$Date),"%y-%m-%d  %H:%M"))
> march2012df <- as.data.frame(march2012)
> xymarch2012 <- coordinates(march2012)
> elemarch2012 <- as.ltraj(xy =xymarch2012, date = da, id = march2012df$ID)
>
> There error message I got was: "Error in as.ltraj(xy = xymarch2012, date = da, id = march2012df$ID) :
>    non unique dates for a given burst".
>
> Before posting this message, I read about duplicates. My dataset includes 10 different elephants, so it could be that some dates are the same. However, I would like to keep these locations because they are different individuals.
>
> I hope I made my problem clear. If you need any more information, please let me know what kind of information and how to send it.
>
> Kind regards,
>
> Nick van Doormaal
> MSc student Forest and Nature Conservation
> Wageningen University, The Netherlands 		 	   		
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

-- 

~$ 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



More information about the R-sig-ecology mailing list