R/swap.R

Defines functions swap

swap <- function(vec, from, to) {
  tmp <- to[match(vec, from)]
  tmp[is.na(tmp)] <- vec[is.na(tmp)]
  return(tmp)
}
RGLab/COMPASS documentation built on Feb. 11, 2021, 3:23 p.m.