I'm trying to analyse revisiting patterns using the new Recurse package (2018). The R package ‘recurse’ calculates revisitations to locations in the movement trajectory or other locations for one or multiple individuals. The package also calculates metrics such as residence time and time between visits. It can be used to quantitatively identify frequently used sites (e.g. dens, nests, foraging locations), to examine patterns of revisitation. A circle of radius R is drawn around each point in the trajectory. The number of revisits is calculated as the number of segments of the trajectory passing through that circle.
All works well, but I have trouble understanding the output. I've put examples of my input(dataframe) and output below. I think to understand that visitIdx is the number of time it is they entered the specific point. My input dates are in the year 2018, but for a reason I don't understand, I get output times around the year 1970. Does somebody know what I'm doing wrong? Lastly, I don't see in what unity timeSinceLastVisit is given.
Can somebody help me?
Thank you very much in advance.
https://cran.r-project.org/web/packages/recurse/recurse.pdf
my simple code
# load trajectory data (routes)
data <- Unites.Trajectory.for.revisitation.analysis
# get recursions with radius of 35 m
library(recurse)
recursion35 <- getRecursions(x=data, radius=35, threshold = 0,timeunits = c("hours"), verbose = TRUE)
revisitation35 <- recursion35$revisitStats
Head of my input (dataframe):
X Y Timestamp Focal group
601019 1933332 2018-02-19 08:26:00 UNITES
600998 1933335 2018-02-19 08:33:00 UNITES
600998 1933335 2018-02-19 12:03:00 UNITES
600984 1933311 2018-02-19 12:09:20 UNITES
600972 1933297 2018-02-19 12:15:40 UNITES
600954 1933301 2018-02-19 12:22:00 UNITES
600954 1933301 2018-02-19 13:13:00 UNITES
600949 1933298 2018-02-19 13:17:00 UNITES
Head of output:
id x y coordIdx visitIdx entranceTime exitTime timeInside timeSinceLastVisit
1 UNITES 601019 1933332 1 1 31-12-1969 18:00 31-12-1969 18:00 0.00076523 NA
2 UNITES 601019 1933332 1 2 31-12-1969 18:00 31-12-1969 18:00 0.000659302 0.01235843
3 UNITES 601019 1933332 1 3 31-12-1969 18:01 31-12-1969 18:01 0.00093708 0.003822967
4 UNITES 601019 1933332 1 4 31-12-1969 18:04 31-12-1969 18:04 0.001767337 0.061540719
5 UNITES 601019 1933332 1 5 31-12-1969 18:05 31-12-1969 18:05 -0.000600144 0.005804636
6 UNITES 601019 1933332 1 6 31-12-1969 18:05 31-12-1969 18:05 0.002684722 0.003184358
You probably just need to convert your Timestamp field into a datetime class before running the getRecursions
function
data$Timestamp<-as.POSIXct(data$Timestamp, format="%Y-%m-%d %H:%M:%S")