Sorry, I meant to add this:
There seems to be a large data set containing duplicated values (see
below). I'm not sure what it exactly means and how to fix this problem
wothout deleting any important date/time values?
Thank you for the help
Julia
My date/time values (TB$gmt) have the following values:
>str(TB$gmt)
POSIXct[1:22274], format: "2010-02-11 17:08:34" "2010-02-11 17:13:36"
"2010-02-11 17:17:55" ...
>dupz = which(duplicated(TB$gmt))
> dupz
[1] 1511 1798 1810 4117 4296 4381 6384 6483 6567 6939
7538 8093 8108
[14] 8449 8453 8580 8707 10995 12550 12555 12567 12656 12680
12738 12830 12910
[27] 13081 13166 13559 13731 13746 13764 13780 13935 14011 14138
14166 14176 14182
[40] 14183 14184 14185 14245 14266 14273 14306 14361 14442 14458
14622 14623 14624
[53] 14625 14633 14765 14842 14911 14974 15000 15016 15088 15096
15150 15235 15238
[66] 15246 15290 15301 15325 15336 15348 15363 15389 15394 15467
15501 15508 15516
[79] 15528 15530 15554 15569 15602 15647 15661 15703 15737 15761
16497 16499 16507
[92] 16521 16532 16537 16544 16553 16574 16585 16606 16620 16622
16771 16773 16778
[105] 17007 17313 17384 17423 17627 17672 18190 18201 18625 18649
18674 18680 19033
[118] 19041 19151 19161 19163 19247 19257 19354 19476 19480 19559
19603 19649 19657
[131] 19712 19806 20033 20114 20122 20159 20234 20238 20305 20357
20392 20410 20520
[144] 20640 20846 20859 20935 20961 21012 21134 21202 21292 21316
21319 21335 21340
[157] 21355 21443 21445 21451 21458 21463 21477 21485 21490 21500
21501 21502 21512
[170] 21515 21519 21520 21523 21526 21527 21536 21565 21572 21581
21595 21616 21636
[183] 21659 21687 21770 21869 21940 21988 22016 22027 22129 22150
22185 22218 22260
> TB$gmt = TB$gmt[-dupz]
Error in `$<-.data.frame`(`*tmp*`, "gmt", value = c(1265908114,
1265908416, :
replacement has 22079 rows, data has 22274
On 14/08/2010, at 3:04 , Tyler Dean Rudolph wrote:
I presume your date/time values are of class POSIXct and do include
times (if they don't adehabitat will think multiple observations on
a given day are duplicates)? If that's all good find out which
POSIXct values are repeated:
dupz = which(duplicated(mydates))
mydates = mydates[-dupz]
Tyler
On 2010-08-14, at 8:49, Julia Sommerfeld <[email protected]> wrote:
Hello,
Thank you for yoir fast reply. I have indeed overlapping dates,
i.e. several birds have the same start and end date. But I'm not
sure how to overcome this problem? Couldn't find anything in
adehabitat.
Cheers
Julia
On 14/08/2010, at 2:38 , Tyler Dean Rudolph wrote:
your problem seems to be that you have duplicate (i.e. more than
one identical) dates for a given burst. I believe there are
arguments in adehabitat to check for this; if not you will need to
verify this first.
On 2010-08-14, at 8:16, Julia Sommerfeld <[email protected]> wrote:
Dear All,
I would like to create an object of class "ltraj" for all GPS
positions (id=Bird) with time, but I always get the following
error message:
Error in as.ltraj(xy, TB$gmt, id, burst, typeII = TRUE, slsp =
c("remove", :
non unique dates for a given burst
Do I need to create a burst? Could anyone tell me what the exact
difference between "id" and "burst" in as.ltraj is?
When a create a ltraj for only one individual (eg. bird 18) it
works fine: tr18<-as.ltraj(xy[TB$Bird=="18",], date=TB$gmt[TB
$Bird=="18"], id="18")
But it doesn't work for all animals...
My script so far:
library(adehabitat)
library(ade4)
library(gpclib)
library(trip)
library(maps)
library(mapdata)
library(fields)
TB<-
as.data.frame(read.table("GPS_2009_2010R.csv",header=T,sep=','))
xy<-TB[,c("LON","LAT")]
id<-TB[,c("Bird")]
### Conversion of the date to the format POSIX
gmt<-(TB$DateTime)
TB$gmt<-as.POSIXct(strptime(gmt, "%d.%m.%Y %H:%M:%S", tz="GMT"))
### Creation of the object of class "ltraj" for GPS positions
with time
tr<-as.ltraj(xy, TB$gmt, id, typeII=TRUE, slsp = c("remove",
"missing"))
My csv.file contains the following columns:
Bird (ID)
DateTime (date and time in one column)
LON (longitude)
LAT (latitude
Thank you very much.
Best regards,
Julia
_______________________________________________
AniMov mailing list
[email protected]
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
_______________________________________________
AniMov mailing list
[email protected]
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Julia Sommerfeld - PhD Candidate
Institute for Marine and Antarctic Studies
University of Tasmania
Private Bag 129, Hobart
TAS 7001
Phone: +61 458 247 348
Email: [email protected]
[email protected]
_______________________________________________
AniMov mailing list
[email protected]
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
_______________________________________________
AniMov mailing list
[email protected]
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Julia Sommerfeld - PhD Candidate
Institute for Marine and Antarctic Studies
University of Tasmania
Private Bag 129, Hobart
TAS 7001
Phone: +61 458 247 348
Email: [email protected]
[email protected]
_______________________________________________
AniMov mailing list
[email protected]
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov