curve {base} | R Documentation |
curve(expr, from, to, n=100, ...)
expr |
an expression, written as a function of
|
from , to |
the range over which the function will be plotted. |
n |
the expression will be evaluated at |
... |
graphical parameters can also be specified as arguments. |
This function draws a curve corresponding to the
given expression (in x
) over the interval
[from,to]
.
It is a quick hack which seems to serve a useful purpose,
but can give bad results for functions which are
discontinuous.
splinefun
for spline interpolation, lines
.
curve(x^3-3*x, -2, 2)