Learn R Programming

hydroloom (version 1.1.2)

rescale_measures: Rescale Aggregate id Measure to id Measure

Description

Given an aggregate_id (e.g. reachcode in NHDPlus) measure and the from and to measure for an id (e.g. COMID flowline in NHDPlus), returns the measure along the id flowline. This is useful where many flowlines make up a single aggregate feature. "Measures" are typically referenced to the aggregate feature. Flowlines have a stated from-measure / to-measure. In some cases it is useful to rescale the measure such that it is relative only to the flowline.

from is downstream -- 0 is the outlet to is upstream -- 100 is the inlet

Usage

rescale_measures(measure, from, to)

Value

numeric rescaled measure

Arguments

measure

numeric aggregate measure between 0 and 100

from

numeric from-measure relative to the aggregate

to

numeric to-measure relative to the aggregate

Examples

Run this code
rescale_measures(40, 0, 50)
rescale_measures(60, 50, 100)

Run the code above in your browser using DataLab