Learn R Programming

network (version 1.18.2)

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)

Value

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

Arguments

x

an object of class network.

vids

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

Author

Carter T. Butts buttsc@uci.edu

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.

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

network

Examples

Run this code

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

Run the code above in your browser using DataLab