plot.latsoc: Plotting latent space models

View source: R/latent_space.R

plot.latsocR Documentation

Plotting latent space models

Description

Plots the fitted network object with node positions determined by latent space modelling. 1 and 2 dimensional fits can be plotted directly, while > 3 dimensional fits use multidimensional scaling to project distances into 2 dimensions.

Usage

## S3 method for class 'latsoc'
plot(
  object,
  post.method = "mean",
  edge.col = NULL,
  edge.lwd = NULL,
  vertex.pch = 21,
  vertex.col = "black",
  vertex.cex = 1,
  labels = F,
  label.col = NULL,
  label.cex = NULL,
  xlim = NULL,
  ylim = NULL
)

Arguments

object

A model returned by latent_space

post.method

Character specifying the method for estimating the posterior latent positions. One of "mean", "median", or "mds", the latter of which uses multidimensional scaling.

edge.col

Square matrix indicating the colors to plot edges. If NULL, edges are plotted in black, with transparency determined by their edge weight.

edge.lwd

Square matrix indicating edge line widths. If NULL, edge widths are proportional to edge weight.

vertex.pch

Plotting characters for vertices/nodes.

vertex.col

A vector indicating the colors for plotting nodes.

vertex.cex

Expansion factor for vertices/nodes.

labels

Logical, should node labels be plotted?

label.col

Colors for vertex labels.

label.cex

Numeric, character expansion factor for labels.

xlim

Optional specification of x limits of plot

ylim

Optional specifical of y limits of plot

Details

This function uses base R plotting methods. More advanced network plotting methods are available (e.g. through the ggraph package), but this interface provides an easy way to visualize the results of the model quickly.


MNWeiss/aninet documentation built on Jan. 31, 2023, 3:55 a.m.