View source: R/rebuild_topology.R
make_node_topology | R Documentation |
creates a node topology table from an edge topology
make_node_topology(x, add_div = NULL, add = TRUE)
x |
data.frame with an identifier and to identifier in the first and second columns. |
add_div |
data.frame containing id and toid diverted paths to add. Should have id and toid fields in the first and second columns. Names are not used. |
add |
logical if TRUE, a tocomid column will be added, otherwise a data.frame with two columns will be returned. |
data.frame containing id, fromnode, and tonode attributes or all attributes provided with id, fromnode and tonode in the first three columns.
source(system.file("extdata/new_hope_data.R", package = "nhdplusTools"))
x <- dplyr::select(get_tocomid(
dplyr::select(new_hope_flowline, COMID, FromNode, ToNode, Divergence, FTYPE,
AreaSqKM, LENGTHKM, GNIS_ID)
), -tonode, -fromnode)
head(y <- make_node_topology(x))
# just the divergences which have unique fromids in x but don't in new hope.
div <- get_tocomid(dplyr::select(new_hope_flowline, COMID, FromNode, ToNode),
return_dendritic = FALSE,
remove_coastal = FALSE)
div <- div[div$tocomid %in%
new_hope_flowline$COMID[new_hope_flowline$Divergence == 2],]
y <- make_node_topology(x, div)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.