Learn R Programming

AnimalHabitatNetwork (version 0.1.0)

ahn_plot: Plot networks

Description

Visualise networks generated by the function ahn_gen.

Usage

ahn_plot(ahn, NodeLabels = unname(V(ahn)), NodeColors = unname(V(ahn)),
  NodeSizes = rep(3, length(V(ahn))))

Arguments

ahn

Networks returned by ahn_gen

NodeLabels

The labels of nodes in ahn (node IDs by default)

NodeColors

The colors of nodes in ahn (each node has a unique color by default)

NodeSizes

The sizes of nodes in ahn (nodes are with the identical size of 3 by default)

Value

Return a plot of the network

Examples

Run this code
# NOT RUN {
# generate a weighted and connected network and plot it by default
N <- 10
x <- runif(N, 0, 5)
ahn <- ahn_gen(N, L = 5, mu = 1, lamda = 5, X = x)
ahn_plot(ahn)

# }
# NOT RUN {
# plot the network with specified colors, labels and sizes for nodes
ahn_plot(
ahn,
NodeColors = sample(4, N, replace = TRUE),
NodeLabels = letters[1:N],
NodeSizes = seq(1, 5, length.out = N))

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab