int(f, a, b, eps=1.0e-6, k=5)
f
| The function to integrate. |
a
| Lower bound. (If non-numeric, taken to be -infty.) |
b
| Upper bound. (If non-numeric, taken to be infty.) |
eps
| Precision. |
k
| Number of points for polynomial interpolation. |
int
performs numerical integration of a given function using the
Romberg method.f <- function(x) sin(x)+cos(x)-x^2 int(f,0,2) # f <- function(x) exp(-(x-2)^2/2) int(f,0,"infty")