permute.vertexIDs: Permute (Relabel) the Vertices Within a Network

View source: R/access.R

permute.vertexIDsR Documentation

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

network

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 documentation built on May 29, 2024, 6:07 a.m.