circular.averaging: Circular Averaging based on Vector Averaging

Description Usage Arguments Details Value Author(s) Examples

View source: R/circular.averaging.R

Description

circular.averaging calculates the average direction (0 - 360) given a vector of directions.

vector.averaging calculates the average distance and direction given a vector of directions and a vector of distances.

Usage

1
2
3
circular.averaging(direction, deg = TRUE)

vector.averaging(direction, distance, deg = TRUE)

Arguments

direction

a vector of directions given in degrees (0 - 360) if deg==TRUE or in radians if deg==FALSE

distance

a vector of distances associated with each direction

deg

a boolean object defining if direction is in degrees (TRUE) or radians (FALSE)

Details

functions return NA if the average distance or direction is not valid... e.g., when averaging directions of 0 & 180 degrees, the result could theoretically be 90 or 270 but is practically neither.

Value

circular.averaging returns the average direction while vector.averaging returns a list with 2 elements distance & direction

Author(s)

Jeremy VanDerWal jjvanderwal@gmail.com & Lorena Falconi lorefalconi@gmail.com

Examples

1
2
3
4
5
6
7
#EXAMPLE circular.averaging
circular.averaging(c(0,90,180,270)) #result is NA
circular.averaging(c(70,82,96,110,119,259))

#EXAMPLE vector.averaging
vector.averaging(c(10,20,70,78,108), distance=10)
vector.averaging(c(159,220,258,273,310),distance=runif(5))

Example output

[1] NA
[1] 99.68147
$distance
[1] 8.035995

$direction
[1] 57.38924

$distance
[1] 0.4692938

$direction
[1] 264.8987

SDMTools documentation built on Jan. 11, 2020, 9:23 a.m.