getPathlength: Calculate the isobole path length

Description Usage Arguments Value Examples

View source: R/Isobole_gridRefinementAlgorithm.R

Description

Calculate the isobole path length

Usage

1
getPathlength(iso, FLAGreturnDT = FALSE)

Arguments

iso

data.table(xp,yp, ...)

FLAGreturnDT

FALSE: return total path length (numeric) TRUE: Return data.table(xp,yp, distToNext, cumDist, totDist, ...)

Value

Depends on FLAGreturnDT: TRUE: data.table, FALSE: numeric(1L)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
iso_unordered <- data.frame(
xp = c(00, 10, 10, 20, 30, 40, 50, 50, 50, 50, 60, 60, 60, 50, 50, 50),
yp = c(80, 80, 70, 60, 60, 70, 70, 60, 50, 40, 30, 40, 20, 20, 10, 0)
)
set.seed(1)
iso_unordered <- iso_unordered[sample(1:nrow(iso_unordered), nrow(iso_unordered)),]
iso_unordered <- data.table(iso_unordered)
iso_ordered <- populationIsoboles:::arrange_isobole_internal(iso_unordered)
populationIsoboles:::getPathlength(iso_unordered)
populationIsoboles:::getPathlength(iso_ordered)

IntiQuan/populationIsoboles documentation built on Jan. 13, 2022, 8:29 p.m.