prod_: Product of a function

View source: R/calculus.R

prod_R Documentation

Product of a function

Description

Product of a function

Usage

prod_(f, var, lower, upper, doit = TRUE)

Arguments

f

Function to take product of

var

Variable to take product for (either string or caracas_symbol)

lower

Lower limit

upper

Upper limit

doit

Evaluate the product immediately (or later with doit())

Examples

if (has_sympy()) {
  x <- symbol("x")
  p <- prod_(1/x, "x", 1, 10)
  p
  as_expr(p)
  prod(1/(1:10))
  n <- symbol("n")
  prod_(x, x, 1, n)
}


caracas documentation built on June 22, 2024, 10:59 a.m.