[AniMov] trajectory question

Heather Moyer HMoyer at Dal.Ca
Tue Oct 18 19:15:29 CEST 2005


Hello,
I am a new student of movement, working on an ultrasonic lobster tagging project
in New Brunswick.  I have been attempting to convert my data into a trajectory
file but have not been able to do so.  Please help!

I have loaded the "adehabitat" package, and set up my data as follows:

lob.dat.zero[1:4,1:4]
       lat     long  tag               date
1 46.58966 64.50456 1002 2004-10-0807:56:00
2 46.60248 64.45351 1003 2004-09-0311:31:00
3 46.60579 64.44084 1003 2004-09-0405:26:00
4 46.66876 64.51301 1003 2004-09-0612:00:00

 then I tried creating the date vector:

 da<-as.POSIXct(strptime(as.character(lobster$date),"%Y-%m-%d%H:%M:%S"))

but my final line:

 lob.traj<-as.traj(id=lobster$tag, xy=lobster[,c("long","lat")],date=da)

always gives this error message:
(Error in if ((as.numeric(x$date))[i] == (as.numeric(x$date))[i - 1]) ind[i] <-
1 : missing value where TRUE/FALSE needed)

I have read the archives for AniMov, and I don't think that my "da" vector is
wrong.  My only other thought is that my latitudes and longitudes are in the
wrong format.

Any suggestions?
Thanks, Heather



More information about the AniMov mailing list