R/util.R

map <- 
function (x, from, to, strict = TRUE, ...) 
{
  stopifnot(length(to) == length(from))
  res <- to[match(x, table = from)]
  if (!strict) 
    res[!(x %in% from)] <- x[!(x %in% from)]
  res
}

Try the define package in your browser

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

define documentation built on July 1, 2020, 6:25 p.m.