scagEdgeWeights: Create a from-to edge matrix with the scagnostic weights

Description Usage Arguments Value Author(s) See Also Examples

View source: R/scagNav.R

Description

Create a from-to edge matrix with the scagnostic weights.

Usage

1
2
3
4
5
6
7
scagEdgeWeights(data,
                scags = c("Clumpy", "NotClumpy", "Monotonic", "NotMonotonic",
                    "Convex", "NotConvex", "Stringy", "NotStringy",
                    "Skinny", "NotSkinny", "Outlying","NotOutlying",
                    "Sparse", "NotSparse", "Striated", "NotStriated",
                    "Skewed", "NotSkewed"),
                combineFn = NULL)

Arguments

data

object to calculate scagnostics on: NG_data, a vector, a matrix or a data.frame.

scags

Single element or a subset of (with possible a "Not" preceding):
"Outlying", "Skewed", "Clumpy", "Sparse", "Striated",
"Convex", "Skinny", "Stringy", "Monotonic"

combineFn

Must be a function that takes in a vector of length scags and returns a single value. This return value comprises the new weights of the nodes get selected from.

Value

a named list with fromToEdgeMatrix being a matrix and nodeNames being a vector.

Author(s)

Adrian Waddell and R. Wayne Oldford

See Also

navGraph, scagNav, scagGraph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(olive)
ng.olive <- ng_data(name = "Olive",
		data = olive[,-c(1,2)],
		shortnames = c("p1","p2","s","ol","l1","l2","a","e"),
		group = as.numeric(olive$Area)+1
)

edgeWts <- scagEdgeWeights(data = ng.olive,
		scags = c("Clumpy", "Skinny"),
		combineFn = max)
edgeWts$fromToEdgeMatrix[1:3,]


edgeWts <- scagEdgeWeights(data = ng.olive,
		scags = c("Clumpy", "Skinny"),
		combineFn = function(x){
			2*x[1]+3*x[2]
		})
edgeWts$fromToEdgeMatrix[1:3,]

RnavGraph documentation built on May 29, 2017, 4:18 p.m.