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

add.isolates

Add Isolates to a Graph


Description

Adds n isolates to the graph (or graphs) in dat.

Usage

add.isolates(dat, n, return.as.edgelist = FALSE)

Arguments

dat

one or more input graphs.

n

the number of isolates to add.

return.as.edgelist

logical; should the input graph be returned as an edgelist (rather than an adjacency matrix)?

Details

If dat contains more than one graph, the n isolates are added to each member of dat.

Value

The updated graph(s).

Note

Isolate addition is particularly useful when computing structural distances between graphs of different orders; see the above reference for details.

Author(s)

Carter T. Butts buttsc@uci.edu

References

Butts, C.T., and Carley, K.M. (2001). “Multivariate Methods for Inter-Structural Analysis.” CASOS Working Paper, Carnegie Mellon University.

See Also

Examples

g<-rgraph(10,5)		#Produce some random graphs

dim(g)			#Get the dimensions of g

g<-add.isolates(g,2)	#Add 2 isolates to each graph in g

dim(g)			#Now examine g
g

sna

Tools for Social Network Analysis

v2.6
GPL (>= 2)
Authors
Carter T. Butts [aut, cre, cph]
Initial release
2020-10-5

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.