Learn R Programming

redistmetrics (version 1.0.11)

by_plan: Shorten District by Plan vector

Description

If x is repeated for each district, it returns a plan level value. Otherwise it returns x.

Usage

by_plan(x, ndists)

Value

x or plan level subset of x

Arguments

x

summary statistic at the district level

ndists

numeric. Number of districts. Estimated as the gcd of the unique run length encodings if missing.

Examples

Run this code
by_plan(letters)
by_plan(rep(letters, each = 2))

Run the code above in your browser using DataLab