Learn R Programming

amen (version 1.4.5)

xnet: Network embedding

Description

Compute an embedding of a sociomatrix into a two-dimensional space.

Usage

xnet(
  Y,
  fm = try(requireNamespace("network", quietly = TRUE), silent = TRUE),
  seed = 1
)

Value

(matrix) A matrix of two-dimensional coordinates.

Arguments

Y

(square matrix) The sociomatrix.

fm

(logical scalar) If TRUE, the Fruchterman-Reingold layout will be used (requires the network package).

seed

(integer) The random seed (the FR layout is random).

Author

Peter Hoff

Details

Coordinates are obtained using the Fruchterman-Reingold layout if the package network is installed, and otherwise uses the first two eigenvectors the sociomatrix.

Examples

Run this code
data(addhealthc3) 
Y<-addhealthc3$Y
X<-xnet(Y) 
netplot(Y,X) 

Run the code above in your browser using DataLab