pos_vec: Average line direction

Description Usage Arguments Details Value

View source: R/ComidScale_Functions.r

Description

Calculates average direction of a line used for concluence angle

Usage

1
pos_vec(p, maxvert = nrow(p), diagnostics = T)

Arguments

p

an points of an sf LINESTRING

maxvert

maximum number of line verticies used to fit regression

diagnostics

logical used for plotting

Details

this function uses orthogonal regression to find the average direction of a series of points and returns the position vector.

max vert is the maximum number of verticies to fit average line

in some instances the function will return NAN when line is near verticle. Could fix this by changing the maximum verticies

Value

position vector of a line unless diagnostics = T


dkopp3/MMASN documentation built on Dec. 20, 2021, 12:07 a.m.