[R-sig-eco] Issue with ltraj function in R for movement analysis
alittle
alittle139 at gmail.com
Mon Feb 9 04:19:09 CET 2015
I'm currently working on an first-passage time analysis under the
adehabitatLT package. To begin, I'm trying to bring my data into R and run a
simple set of movement metrics output by the ltraj function. My data
consists of individual animal IDs, date, time, and x,y coordinates. I
followed the adehabitatLT vignette but continue to get the following error:
Error in as.ltraj(xy = data[, c("X", "Y")], date = das, id = data$NewID2, :
non unique dates for a given burst
My data is structured as follows:
*NewID2 NewDate Time X Y*
1401FR141732 140403 6:57:00 PM 111111 2222222
1401FR141732 140403 7:37:00 PM 111123 2222243
1401FR141732 140403 7:57:00 PM 111135 2222264
1401FR141732 140403 8:17:00 PM 111147 2222285
1401FR141732 140403 8:37:00 PM 111159 2222306
1401FR141732 140403 8:57:00 PM 111171 2222327
1401FR141732 140403 9:17:00 PM 111183 2222348
1401FR141732 140403 9:37:00 PM 111195 2222369
1401FR141732 140403 9:57:00 PM 111207 2222390
1401FR141732 140403 10:17:00 PM 111219 2222411
1401FR141732 140403 10:37:00 PM 111231 2222432
1401FR141732 140403 11:17:00 PM 111243 2222453
*R-code: *
data<-read.csv("FPT_Ready_for_R_282015.csv")
head(data)
das <- as.character(data$NewDate)
head(das)
das <- as.POSIXct(strptime(as.character(data$NewDate)
newcoon <- as.ltraj(xy = data[,c("X","Y")], date = das, id=data$NewID2,
burst=data$NewID2,typeII = TRUE)
The NewID2 was designed to be a unique ID for a unique first-passage time
run and date. However, I continue to receive the same error about non unique
dates for a given burst. This doesn't make sense given that I have a
specific run for one animal on a specific date with individual times for
each location. This coding doesn't seem to take into account the time
between successive locations. Maybe I'm missing something.
Additionally, the data is based on VHF locations; therefore, the time lag
between successive locations is irregular. I eventually need to interpolate
locations every 1-m along the path for the first-passage time analysis and
I'm unclear on the exact process of how to do this using adehabitatLT.
I appreciate any help on my issues. Thank you!
--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/Issue-with-ltraj-function-in-R-for-movement-analysis-tp7579295.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.
More information about the R-sig-ecology
mailing list