Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/plot.schematic.R
Plots a schematic representation of the movement from site to site, but does not include returns to the same site.
1 2 3 |
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 |
R |
radius value to use |
first |
if |
number_sites |
number of sites to manually show the results for |
len_arrow |
length of the arrows |
lwd_arrow |
thickness of the arrows |
lwd_r |
width of the hoops |
text_size |
size of the labels |
legend_loc |
location of the legend |
... |
additional arguments to plot |
This function plots a schematic representation of the animal's movements from site to site, with arrows indicating the direction of movement. This plot simplifies the movements of the animal so that movement is only direct from site to site. Several features of the plot can be defined including; the size of the arrow heads, thickness of the arrows and hoops, text size of the arrow labels and the location of the legend.
Plot of the schematic representation
Rhys Munden <rdmunden1@sheffield.ac.uk>
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.
See also Alt_Alg
to find the residence times. Sites
can be used to find the coordinates of the centres of the sites from the csv files produced by Alt_Alg
. print_site_visits
prints the order of sites visited, the length of time for each visit and the amount of time spent between site visits.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ##Find the current working directory
wd = getwd()
##Set the working directory as the temporary one
setwd(tempdir())
##Load the data
data(OU_14)
t=unlist(OU_14["t"])
X=unlist(OU_14["X"])
Y=unlist(OU_14["Y"])
class(X) = "schematic"
class(Y) = "schematic"
##Calculate the residence time with a radius of 0.3 and not including the first circle
Alt_Alg("OU_14",t,X,Y,0.3,first='y',save='y')
##Plot the schematic representation of movements between sites
plot(X,Y,"OU_14",0.3,first='y')
##There is also the option to make changes to:
##the length of the arrow head
plot(X,Y,"OU_14",0.3,first='y',len_arrow=0.25)
##the thickness of the arrow
plot(X,Y,"OU_14",0.3,first='y',lwd_arrow=2)
##the thickness of the hoops
plot(X,Y,"OU_14",0.3,first='y',lwd_r=2)
##the size of the arrow labels
plot(X,Y,"OU_14",0.3,first='y',text_size=2)
##the location of the legend
plot(X,Y,"OU_14",0.3,first='y',legend_loc="bottomleft")
##Reset the original working directory
setwd(wd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.