permute.vertexIDs | R Documentation |
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.
permute.vertexIDs(x, vids)
x |
an object of class |
vids |
a vector of vertex IDs, in the order to which they are to be permuted. |
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.
Invisibly, a pointer to the permuted network.
permute.vertexIDs
modifies its argument in place.
Carter T. Butts buttsc@uci.edu
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/
network
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.