Learn R Programming

SitesInterest (version 1.0)

plot.displacement: Plots the displacement from a particular point over a chosen window

Description

The displacement from a particular point to every other point along the animal's trajectory is calculated and this is then plotted over a defined window.

Usage

# S3 method for displacement
plot(x, y, Name, t, R, t_a, t_1, t_2, ...)

Arguments

x

array of the x-coordinates describing the trajectory

y

array of the y-coordinates describing the trajectory

Name

name of the data, which is used for any saved files and plot titles

t

an array of the times that the positions are recorded at

R

radius value to use

t_a

starting time to calculate the displacement from

t_1

start of interval to view the displacement over

t_2

end of interval to view the displacement over

...

additional arguments to plot

Value

Plot of the displacement

Details

The displacement from a particular time point (t_a) to every other point along the trajectory is calculated and this is then plotted over a defined window [t_1, t_2]. A line representing the radius is also drawn to see when the trajectory enters or leaves the circle centred at the point (t_a). This plot can be used to see how far away the animal moves after leaving a particular circle.

References

Munden, R., Borger , L., Wilson, R.P., Redcliffe, J., Loison, A., Garel, M. and Potts, J.P. in review. Making sense of ultra-high-resolution movement data: an algorithm for inferring sites of interest.

Examples

Run this code
# NOT RUN {
##Load the data
data(OU_14)
t=unlist(OU_14["t"])
X=unlist(OU_14["X"])
Y=unlist(OU_14["Y"])

class(X) = "displacement"
class(Y) = "displacement"

##Plot the displacement from the starting point (t=0) for t=0 to t=2.9999
plot(X, Y, "OU14", t, 0.3, 0, 0, 2.9999)
# }

Run the code above in your browser using DataLab