Learn R Programming

caracas (version 1.0.1)

intf: Integrate a function

Description

If no limits are provided, the indefinite integral is calculated. Otherwise, if both limits are provided, the definite integral is calculated.

Usage

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

Arguments

f

Function to integrate

var

Variable to integrate with respect to (either string or caracas_symbol)

lower

Lower limit

upper

Upper limit

doit

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

Examples

Run this code
# NOT RUN {
if (have_sympy()) {
  x <- symbol("x")
  
  intf(1/x, x, 1, 10)
  intf(1/x, x, 1, 10, doit = FALSE)
  intf(1/x, x)
  intf(1/x, x, doit = FALSE)
}

# }

Run the code above in your browser using DataLab