rescaleNetwork: Rescale network

Description Usage Arguments Value Examples

View source: R/rescaleNetwork.R

Description

Normalize network coordinates to the unit cube while maintaining its geography.

Usage

1
rescaleNetwork(x, method = "global2")

Arguments

x

[Network]
Network.

method

[character(1)]
Rescaling method which actually modifies the coordinates. Currently there are three methods available:

by.dimension

Scaling is performed for each dimension independently.

global

Here we shift all the points toward the origin by the minimum of both x and y coordiantes and devide by the range of global maximim and minimum.

global2

Here wer shift - analogously to the by.dimension strategy - dimension wise and devide by the maximum of the ranges in x respectivly y direction.

Default is global2, which leads to the most “natural” rescaling.

Value

[Network]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
library(gridExtra)
x = generateClusteredNetwork(n.points = 100L, n.cluster = 4L, name = "Rescaling Demo")

# here we "stretch" the instance x direction to visualize the differences of
# the rescaling mehtods
x$coordinates[, 1] = x$coordinates[, 1] * 10L
x$upper = x$upper * 10L
pls = list(
  autoplot(x) + ggtitle("Original"),
  autoplot(rescaleNetwork(x, method = "by.dimension")) + ggtitle("By dimension"),
  autoplot(rescaleNetwork(x, method = "global")) + ggtitle("Global"),
  autoplot(rescaleNetwork(x, method = "global2")) + ggtitle("Global2")
)
pls$nrow = 1L
do.call(grid.arrange, pls)

## End(Not run)

netgen documentation built on Jan. 9, 2020, 1:07 a.m.