build.node.data: Build node data

View source: R/build.node.data.R

build.node.dataR Documentation

Build node data

Description

Helper function to build the origin/destination node data structure.

Usage

build.node.data(x, group.ids, from.parms, to.parms = NULL)

Arguments

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

Value

data.frame

Note

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).

Author(s)

Jeffrey S. Evans <jeffrey_evans@tnc.org> and Melanie A. Murphy <melanie.murphy@uwyo.edu>

Examples

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 ) 
 

GeNetIt documentation built on July 9, 2023, 5:18 p.m.