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

permute.vertexIDs

Permute (Relabel) the Vertices Within a Network


Description

permute.vertexIDs permutes the vertices within a given network in the specified fashion. Since this occurs internally (at the level of vertex IDs), it is rarely of interest to end-users.

Usage

permute.vertexIDs(x, vids)

Arguments

x

an object of class network.

vids

a vector of vertex IDs, in the order to which they are to be permuted.

Details

permute.vertexIDs alters the internal ordering of vertices within a network. For most practical applications, this should not be necessary – de facto permutation can be accomplished by altering the appropriate vertex attributes. permute.vertexIDs is needed for certain other routines (such as delete.vertices), where it is used in various arcane and ineffable ways.

Value

Invisibly, a pointer to the permuted network. permute.vertexIDs modifies its argument in place.

Author(s)

Carter T. Butts buttsc@uci.edu

References

Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). https://www.jstatsoft.org/v24/i02/

See Also

Examples

data(flo)                     #Load the Florentine Families data
nflo<-network(flo)                      #Create a network object
n<-network.size(nflo)                #Get the number of vertices
permute.vertexIDs(nflo,n:1)                #Reverse the vertices
all(flo[n:1,n:1]==as.sociomatrix(nflo))          #Should be TRUE

network

Classes for Relational Data

v1.16.1
GPL (>= 2)
Authors
Carter T. Butts [aut, cre], David Hunter [ctb], Mark Handcock [ctb], Skye Bender-deMoll [ctb], Jeffrey Horner [ctb], Li Wang [ctb]
Initial release
2020-10-06

We don't support your browser anymore

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