cs_group: Cumulative sum area grouping

cs_groupR Documentation

Cumulative sum area grouping

Description

This function takes a vector of areas and lengths and returns a index vector that combines them towards an ideal aggregate area (athres). While enforcing a minimum area (amin) and length (lmin). Additionally, this function can take a set of indexes to exclude over which the network cannot be aggregated.

Usage

cs_group(areas, lengths, exclude, ideal_size_sqkm, amin, lmin)

Arguments

areas

a vector of areas

lengths

a vector of lengths

exclude

a vector of equal length to areas and lengths. Any non NA value will be used to enforce an aggregation break

ideal_size_sqkm

a vector of areas

amin

a threshold, or target, cumulative size

lmin

a threshold, or target, cumulative size

Value

a vector of length(areas) containing grouping indexes


NOAA-OWP/hyAggregate documentation built on Aug. 13, 2022, 1:36 p.m.