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

autoplot.Network

Autoplot function.


Description

Generates a ggplot object. Nice possibility to visualize 2-dimensional (clustered) networks in the euclidean plane.

Usage

## S3 method for class 'Network'
autoplot(object, path = NULL, close.path = FALSE,
  path.colour = "gray", use.opt.tour = FALSE, ...)

Arguments

object

[Network]
Network.

path

[integer]
An integer vector containing the order of cities of a path or a list of multiple paths. Keep in mind that instances with n nodes and m depots have n + m coordinates, with the 1,…,m first coordinates belonging to the depots.

close.path

[logical(1)]
Logical indicating whether the path passed by path should be closed to a cycle. Default is FALSE.

path.colour

[character(1)]
Colour of the lines linking nodes on a path. Default is “gray”.

use.opt.tour

[logical(1)]
If the given network knows its optimal tour, should it be plotted? If this is the case and path is given additionally, the optimal tour is ignored. Default is FALSE.

...

[any]
Currently not used.

Value

Examples

## Not run: 
# here we have no depots ...
x = generateClusteredNetwork(n.points = 30L, n.cluster = 2L)
pl = autoplot(x, path = 1:3)
# ... and here we have two depots: the path visits the depots in this case
x = generateRandomNetwork(n.points = 30L, n.depots = 2L)
pl = autoplot(x, path = 1:3, path.colour = "tomato")

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