R/reversemapping.R

Defines functions reverseMap

###### borrowed code found online #################################################
#Description: Reverses the direction of a bidirectional mapping, removes an entries pointing to NULL
#Author: Matthew Young
#Date Modified: 13/12/2010
reverseMap=function(map){
  tmp=unlist(map,use.names=FALSE)
  names(tmp)=rep(names(map),times=as.numeric(summary(map)[,1]))
  return(split(names(tmp),as.vector(tmp)))
}
#########################################

Try the rgsepd package in your browser

Any scripts or data that you put into this service are public.

rgsepd documentation built on Nov. 8, 2020, 4:58 p.m.