[R-sig-eco] AdehabitatLT mean distance travelled

Vlachopoulos Konstantinos kostisvlachopoulos at gmail.com
Fri Feb 6 17:00:14 CET 2015


Dear List,
I am new to movement ecology and to R as well.
As you will se I have GPS data from Lesser Kestrels, and I am trying to
calculate the mean distance travelled/per day, actually the distance
travelled per burst. My coordinates are in WGS84 but I transform
in Greek_Geodetic_Reference_System_1987 (GGRS87), where the X is measured
in thousands (in meteres) and Y in million (in meteres).  Finally I get a
result but it looks like quiet strange to me, I think that finally the mean
distance is in meters, but I would like your advice. It is 7 or jus point



Here is the script :

require(sp)
require(Rcmdr)
require(chron)
require(adehabitatLT)
require(spatstats)
require(rgdal)
AI8 <- read.csv("~/R/Montplier/AI8.csv", sep=";", dec=",")


AI8$ID<-rep("AI8",433)
AI8$stmp<-paste(AI8$DATE,AI8$TIME)
timeconv<-as.POSIXct(AI8$stmp, tz="UTC")
AI8$timeconv<-timeconv
latlong <- SpatialPoints(AI8[ , c("LONG","LAT")],
proj4string=CRS("+proj=longlat +ellps=WGS84"))
AI8$spoints<-spTransform(latlong, CRS("+init=epsg:2100"))
timediff <- diff(AI8$timeconv)
AI8<-AI8[-1,]
AI8$timediff<-as.numeric(abs(timediff))
trajectory <- as.ltraj(coordinates(AI8$spoints),AI8$timeconv,id=AI8$ID)
plot(trajectory)
trajectory
foo <- function(dt) {
   return(dt> (1*3600*24))
  }
cut<-cutltraj(trajectory, "foo(dt)", nextr = TRUE)
cut

I get as usual the charactiritsics of the ltraj

*********** List of class ltraj ***********

Type of the traject: Type II (time recorded)
Irregular traject. Variable time lag between two locs

Characteristics of the bursts:
   id burst nb.reloc NAs          date.begin            date.end
1 AI8 AI8.1      432   0 2014-05-29 09:17:06 2014-05-30 14:33:43
##change ltraj to a data.frame to summarize distance between locations for
each daily burst
head(cut)
df.cut <- ld(cut)
head(df.cut)
str(df.cut)

##change ltraj to a data.frame to summarize distance between locations for
each daily burst
> head(cut)

*********** List of class ltraj ***********

Type of the traject: Type II (time recorded)
Irregular traject. Variable time lag between two locs

Characteristics of the bursts:
   id burst nb.reloc NAs          date.begin            date.end
1 AI8 AI8.1      432   0 2014-05-29 09:17:06 2014-05-30 14:33:43


 infolocs provided. The following variables are available:
[1] "pkey"
> df.cut <- ld(cut)
> head(df.cut)

 summary <- numSummary(df.cut[,"dist"],groups=df.cut$burst,
statistics=c("mean","sd"))
 summary
     mean      sd   n NA
 132.9685 388.137 431  1

*The mean "132.9685" mean 1329685 meter or is 132 meters point somesting...*




Sorry for the silly question and thanks for the help!

Yours sincerely,

Konstantinos Vlachopoulos
-- 
*Konstantinos Vlachopoulos*
Environmental Scientist, MSc Environmental Management
Phd Student
Laboratory of Ecosystem Management and Biodiversity
Department of Agriculture Crop Production and Rural Environment
University of Thessaly

	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list