Last data update: 2014.03.03

R: Build node data
build.node.dataR Documentation

Build node data

Description

Helper funtion 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 contaning node (site) data

group.ids

Character vector of unique identifer 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 garavity 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 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(ralu.site@data, group.ids = c("SiteName"), 
                        from.parms = site.parms ) 
 

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GeNetIt)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GeNetIt/build.node.data.Rd_%03d_medium.png", width=480, height=480)
> ### Name: build.node.data
> ### Title: Build node data
> ### Aliases: build.node.data
> 
> ### ** 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(ralu.site@data, group.ids = c("SiteName"), 
+                         from.parms = site.parms ) 
>  
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>