Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_node

Get flowline node


Description

Given one or more flowlines, returns a particular node from the flowline.

Usage

get_node(x, position = "end")

Arguments

x

sf data.frame with one or more flowlines

position

character either "start" or "end"

Examples

source(system.file("extdata/sample_data.R", package = "nhdplusTools"))

fline <- sf::read_sf(sample_data, "NHDFlowline_Network")

start <- get_node(fline, "start")
end <- get_node(fline, "end")

plot(sf::st_zm(fline$geom),
     lwd = fline$StreamOrde, col = "blue")
plot(sf::st_geometry(start), add = TRUE)

plot(sf::st_zm(fline$geom),
     lwd = fline$StreamOrde, col = "blue")
plot(sf::st_geometry(end), add = TRUE)

nhdplusTools

NHDPlus Tools

v0.4.0
CC0
Authors
David Blodgett [aut, cre], Mike Johnson [ctb] (<https://orcid.org/0000-0002-5288-8350>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.