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

View source: R/Alt_Alg_discont.R

Calculates the residence times from discontinuous data, which can then be used to identify sites of interest. This could also be used to identify sites for a group of animals, by treating each animal's trajectory as one segment of a discontinuous set.

1 | ```
Alt_Alg_discont(Overall_name,Names, t_all, X_all, Y_all, R, s = 10, m = 500, save = 'n')
``` |

`Overall_name` |
name for the set of separate trajectories |

`Names` |
list of names for each trajectory |

`t_all` |
list of arrays, one for each trajectory of times when the positions were recorded |

`X_all` |
list of arrays, one for each trajectory of x-coordinates |

`Y_all` |
list of arrays, one for each trajectory of y-coordinates |

`R` |
radius value to use |

`s` |
number of time steps between checks for entrances and exits |

`m` |
estimate of the maximum number of crossings across all circles |

`save` |
if |

This function is used specifically with discontinuous data to calculate the residence times for the trajectories. It works in the same way as for `Alt_Alg`

, by linking together `Alt_Alg_mini`

and `combining`

.

Rhys Munden <[email protected]>

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`

for the algorithim used on continuous data. `Alt_Alg_mini`

is used to calculate the residence times for a particular set of circles and a particular trajectory, then using `combining`

all the residence times for the same circles are summed.

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 | ```
##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"])
##Number of path sections
n=5
##Number of recorded locations
N = length(t)
##A list of arrays of the time recoding for the 3 of the trajectory segments
t_all = list(t[seq(1,floor(N/n))], t[seq(floor(N/n)*2,floor(N/n)*3)],
t[seq(floor(N/n)*4,floor(N/n)*5)])
##A list of arrays of the x-coordinates for the 3 of the trajectory segments
X_all = list(X[seq(1,floor(N/n))], X[seq(floor(N/n)*2,floor(N/n)*3)],
X[seq(floor(N/n)*4,floor(N/n)*5)])
##A list of arrays of the y-coordinates for the 3 of the trajectory segments
Y_all = list(Y[seq(1,floor(N/n))], Y[seq(floor(N/n)*2,floor(N/n)*3)],
Y[seq(floor(N/n)*4,floor(N/n)*5)])
##The calculation of the residence time for discontibuous data
Alt_Alg_discont("OU_14_discont",c("OU_14.1","OU_14.3","OU14.5"),t_all,X_all,Y_all,0.3,save='y')
##Reset the original working directory
setwd(wd)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.