Learn R Programming

caracas (version 1.0.1)

prodf: Product of a function

Description

Product of a function

Usage

prodf(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

Run this code
# NOT RUN {
if (have_sympy()) {
  x <- symbol("x")
  p <- prodf(1/x, "x", 1, 10)
  p
  as_r(p)
  prod(1/(1:10))
  n <- symbol("n")
  prodf(x, x, 1, n)
}

# }

Run the code above in your browser using DataLab