plot_bar_chart: Plot the bar chart of residence times

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/plot_bar_chart.R

Description

This function plots the bar chart of residence times with the ones that correspond to the sites of interest highlighted by a change in colour.

Usage

1
plot_bar_chart(Name, R, first='n', number_sites=-1, colours= c("red","darkgreen"))

Arguments

Name

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

R

radius value to use

first

if 'y', the algorithm will look for the second greatest maximum percent drop if the first results in the first circle being the only non-identified site

number_sites

number of sites to manually show the results for

colours

list of the bars' colours

Details

Plots the bar chart of ranked residency times of non-overlapping circles. The percent drops are the relative differences between these consecutive bars and where the maximum percent drop occurs is identified using a change in colour between the bars. This plot can be used to see the percent drops visually and if the maximum percent drop can easily be identified by sight.

Value

Bar chart plot of the the residence times of non-overlapping circles

Author(s)

Rhys Munden <rdmunden1@sheffield.ac.uk>

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.

See Also

See also Alt_Alg to find the residence times. Sites can be used to find the coordinates of the centres of the sites and non-overlapping circles from the csv files produced by Alt_Alg.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
##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"])

##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 bar chart of ranked non-overlapping residence times
plot_bar_chart("OU_14",0.3,first='y')

##It is possible to choose manually where the cut off between sites and none sites should be
plot_bar_chart("OU_14",0.3,first='y', number_sites=4)

##The colours can also be changed
plot_bar_chart("OU_14",0.3,first='y', colours = c("darkgreen","red"))

##Reset the original working directory
setwd(wd)

SitesInterest documentation built on May 2, 2019, 4:25 a.m.