| hy | R Documentation |
converts a compatible dataset into a fabric s3 class.
Automatically detects the network representation and classifies the
result as the most specific hydroloom subclass (e.g. hy_topo,
hy_node). With add_topo = TRUE, also auto-builds
topology (e.g. toid from fromnode/tonode).
hy(x, clean = FALSE, add_topo = FALSE)
x |
data.frame network compatible with hydroloom_names. |
clean |
logical if TRUE, geometry and non-hydroloom compatible attributes will be removed. |
add_topo |
logical. If TRUE, auto-build topology (e.g. toid from fromnode/tonode) and classify into subclass hierarchy. If FALSE (default), classify based on existing columns only without constructing new attributes. |
hy object with attributes compatible with the hydroloom package.
x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))
hy(x)
hy(x, clean = TRUE)[1:10, ]
attr(hy(x), "orig_names")
# auto-build toid from fromnode/tonode
hy(x, add_topo = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.