plot.NetSim: Plot a simulated network from a NetSim object

Description Usage Arguments Details Value Author(s) Examples

View source: R/NetSim.R

Description

This can take either a PowerLawNetwork or APLNetwork object as input, both of which are chidren of the NetSim class.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'NetSim'
plot(
  x,
  y,
  ...,
  layout = "stress",
  title = "Network Simulation",
  node_color = "red",
  edge_color = "blue"
)

Arguments

x

a NetSim graph

y

ignored.

...

ignored.

layout

a layout to display the graph. Layout must be a valid string. from the ggraph package. Default is "stress".

title

an optional title.

node_color

a color for the nodes. Default is blue.

edge_color

a color for the edges. Default is red.

Details

This method returns a ggraph object, which can be further refined using standard ggraph and ggplot facilities.

Value

A plot of classes 'ggraph' 'gg' and 'ggplot'

Author(s)

Darren Colby
Email:dscolby17@gmail.com

Examples

1
2
3
4
5
6
7
# Load spacejamr object
data("RI")

ri_points <- PointSim(points = 10, window = RI, seed = 42)
spl_points <- NetSim(ri_points, base_prob = 0.92, scale = 1, threshold = 0.5,
                     power = -2.4)
plot(spl_points)

spacejamr documentation built on Sept. 13, 2021, 1:06 a.m.