R/perturbation.R

Defines functions perturbation

Documented in perturbation

perturbation <- function(x, y, oper = "+") {

  if ( is.vector(y) ) {
    a <- Rfast::eachrow(x, y, oper = oper)
  } else {
    if (oper == "+")  a <- x * y
    if (oper == "-")  a <- x / y
  }
  
  a / Rfast::rowsums(a)
}

Try the Compositional package in your browser

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

Compositional documentation built on Oct. 9, 2024, 5:10 p.m.