Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rescaleNetwork

Rescale network


Description

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

Usage

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

## 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

Network Generator for Combinatorial Graph Problems

v1.3.2
BSD_3_clause + file LICENSE
Authors
Jakob Bossek [aut, cre]
Initial release
2020-01-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.