dist_cent: Distance to center

Description Usage Arguments Value Examples

Description

Distances to frequently used areas. distance_to_center calculates the distance to the home-range center (i.e., the centroid of the x and y coordinates). distance_to_centers calculates the distance to top_n most frequently used cells. Note, that the results of distance_to_center is different to distance_to_centers with top_n = 1, since in the first case the distance to the centroid is calculated and in the second case the distance to the raster cell with the most relocations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
distance_to_center(x, ...)

## S3 method for class 'track_xy'
distance_to_center(x, trast, square = TRUE, ...)

## S3 method for class 'numeric'
distance_to_center(x, trast, square = TRUE, ...)

distance_to_centers(x, ...)

## S3 method for class 'track_xy'
distance_to_centers(x, trast, top_n = 10, square = TRUE, ...)

Arguments

x

[track_xy, track_xyt]
A track created with make_track.

...

Further arguments, none implemented.

trast

[RasterLayer]
A template.

square

[logical(1)]
Should the distance be squared?

top_n

[integer(1)]
To how many centers should the distance be calculated?

Value

RasterLayer

Examples

1
2
3
4
5
data(deer)
r <- raster::raster(bbox(deer, buffer = 100), res = 40)
d1 <- distance_to_center(deer, r)
d2 <- distance_to_centers(deer, r, top_n = 1)
d3 <- distance_to_centers(deer, r, top_n = 10)

amt documentation built on Jan. 18, 2021, 5:05 p.m.