View source: R/build.node.data.R
build.node.data | R Documentation |
Helper function to build the origin/destination node data structure.
build.node.data(x, group.ids, from.parms, to.parms = NULL)
x |
A data.frame containing node (site) data |
group.ids |
Character vector of unique identifier that can be used to join to graph |
from.parms |
Character vector of independent "from" variables |
to.parms |
Character vector of independent "to" variables. If NULL is the same as from.parms |
data.frame
Unless a different set of parameters will be used as the destination (to) there is no need to define the argument "to.parms" and the "from.parm" will be used to define both set of parameters.
The resulting data.frame represents the origin (from) and destination (to) data structure for use in gravity model. This is node structure is also know in the gravity literature as producer (from) and attractor (to).
Jeffrey S. Evans <jeffrey_evans@tnc.org> and Melanie A. Murphy <melanie.murphy@uwyo.edu>
data(ralu.site)
# Build from/to site (node) level data structure
site.parms = c("AREA_m2", "PERI_m", "Depth_m", "TDS")
site <- build.node.data(sf::st_drop_geometry(ralu.site),
group.ids = c("SiteName"),
from.parms = site.parms )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.