remap.id {dynamicnetwork} | R Documentation |
returns the index of the id in the subsample, effectively translating it to an id usable as a vertex id
remap.id(id, subsample)
id |
unique id that needs to be translated to a vertex id |
subsample |
list of all unique ids |
provides an easy way to map back and forth between a vertex id (that must be an integer suitable for a matrix index) and any other unique id labeling system used in input data.
an integer giving a vertex id that is an index number on the list of ids on the passed list.
skyebend@skyeome.net
#list of unique ids using some other naming scheme idlist <- c("a","b","c","d"); #get a vertex id remap.id("c",idlist); #returns 3 #chech that it translates back.. idlist[remap.id("c",idlist)]; # yup, returns "c"