[R-sig-Geo] Trouble with first passage time analysis
Clement Calenge
clement.calenge at oncfs.gouv.fr
Tue Oct 30 09:08:03 CET 2012
> I posted this question a few days ago on a different forum, and was directed
> here. Hopefully someone will be able to help me out. I've managed to figure
> out just about everything I need, I'm just left with one unresolved issue.
> I'm fine up to the point of creating the ltraj object from a dataset.
>
> /test<-read.table("~/Desktop/R_Directory/test.txt",header=TRUE)
> attach(test)
> library(adehabitatLT)
> xy<-test[,c("x","y")]
> date1<-as.character(date)
> date<-as.POSIXct(date1)
> fit1<-as.ltraj(xy,date,id=test$name,burst=name,typeII=TRUE)/
>
> from here things start to get fuzzy...
>
>
> Instead of following the basic expression,
>
> /fpt(lt, radii, units = c("seconds", "hours", "days"))/
>
>
> the sample code on the tutorial expressed fpt as,
>
> /fpt(lt, seq(300,1000, length=30))/
>
>
> But as far as I can tell this code does not set a specific radius distance
> (e.g., 100 m), but rather defines how many radii are to be distributed
> across the dataset.
radii is a vector containing the radii of the circle. Actually:
> seq(300,1000, length=30)
[1] 300.0000 324.1379 348.2759 372.4138 396.5517 420.6897 444.8276
[8] 468.9655 493.1034 517.2414 541.3793 565.5172 589.6552 613.7931
[15] 637.9310 662.0690 686.2069 710.3448 734.4828 758.6207 782.7586
[22] 806.8966 831.0345 855.1724 879.3103 903.4483 927.5862 951.7241
[29] 975.8621 1000.0000
Therefore, the fpt will be calculated for a circle with a radius 300 m,
for another circle with radius 324 m, etc. The use of the function seq()
is just a way to generate quickly a vector of values for radii. But you
can generate a vector of radii yourself, e.g. with:
fpt(lt, radii=300, units = c("seconds", "hours", "days"))
To calculate the fpt for a radius equal to 300 m. Or,
fpt(lt, radii=c(300, 500), units = c("seconds", "hours", "days"))
To calculate the fpt for a radius equal to 300 m, and for a radius equal
to 500 m.
HTH,
Clément Calenge
--
Clément CALENGE
Cellule d'appui à l'analyse de données
Direction des Etudes et de la Recherche
Office national de la chasse et de la faune sauvage
Saint Benoist - 78610 Auffargis
tel. (33) 01.30.46.54.14
More information about the R-sig-Geo
mailing list