R/incremental.R

Defines functions `%**%` `%+%`

#' Compounded addition
#' @export
#' @param x The object to increment.
#' @param y The value by which to increment.
`%+%` <- function(x, y){
    eval.parent(substitute(x <- x + y))
}

#' Compounded multiplication
#' @export
#' @param x The object to increment.
#' @param y The value by which to increment.
`%**%` <- function(x, y){
    eval.parent(substitute(x <- x * y))
}
stuart-morrison/sumo documentation built on Jan. 2, 2025, 8:45 p.m.