inst/Examples/changeFunctions.R

changeFunctions <- function(expr, old, new) {
  if(is.recursive(expr)) {
    i <- match(as.character(expr[[1]]), old)
    if(!is.na(i))
      expr[[1]] <- as.name(new[[i]])
    n <- length(expr)
    if(n > 1) for(i in 2:n)
      expr[[i]] <- Recall(expr[[i]], old, new)
  }
  expr
}

Try the SoDA package in your browser

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

SoDA documentation built on Oct. 28, 2020, 9:07 a.m.