remap.id {dynamicnetwork}R Documentation

translates an id to an id in a subsample

Description

returns the index of the id in the subsample, effectively translating it to an id usable as a vertex id

Usage

remap.id(id, subsample)

Arguments

id unique id that needs to be translated to a vertex id
subsample list of all unique ids

Details

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.

Value

an integer giving a vertex id that is an index number on the list of ids on the passed list.

Author(s)

skyebend@skyeome.net

Examples


#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"

[Package dynamicnetwork version 0.0-4 Index]