Learn R Programming

riverdist (version 0.17.0)

trimriver: Trim a River Network Object to Specified Segments

Description

Removes line segments from a river network object. User can specify which segments to remove (trim) or which segments to keep (trimto).

Usage

trimriver(trim = NULL, trimto = NULL, rivers)

Value

A new river network object

Arguments

trim

Vector of line segments to remove

trimto

Vector of line segments to keep

rivers

The river network object

Author

Matt Tyers

See Also

line2network

Examples

Run this code
data(Kenai1)
plot(x=Kenai1)

Kenai1.trim <- trimriver(trim=c(46,32,115,174,169,114,124,142,80), rivers=Kenai1)
plot(x=Kenai1.trim)
 
Kenai1.trim.2 <- trimriver(trimto=c(20,57,118,183,45,162,39,98,19), rivers=Kenai1)
plot(x=Kenai1.trim.2)

Run the code above in your browser using DataLab