This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/curve.html
curve {base}R Documentation

Draw Function Plots

Usage

curve(expr, from, to, n=100, ...)

Arguments

expr

an expression, written as a function of x which will be plotted.

from, to

the range over which the function will be plotted.

n

the expression will be evaluated at n points equally spaced over the range [from, to]. The points determined in this way are then joined with straight lines.

...

graphical parameters can also be specified as arguments.

Value

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.

See Also

splinefun for spline interpolation, lines.

Examples

curve(x^3-3*x, -2, 2)

[Package base version 0.60 ]