Learn R Programming

scanstatistics (version 0.1.0)

partition_zones: Partition a set of zones.

Description

Partition a set of zones such that each part contains about the same number of locations, when the number of locations in each zone for the part are summed over all zones in the part.

Usage

partition_zones(zones, n_parts = min(10L, length(zones)))

Arguments

zones

A set of zones, each zone itself being a set containing locations. Locations should be encoded as integers.

n_parts

An integer; the number of parts to split the zones into.

Value

A list with two elements:

  • partition A list, each element of which is a set containing one or more zones (set containing locations).

  • offsets An integer vector containing offset numbers to the zone numbering. For example, the first zone in partition[i] will have will be zone number offset[i] + 1.