| Line 79... |
Line 79... |
| 79 |
|
79 |
|
| 80 |
This used to be a quick hack which now seems to serve a useful purpose,
|
80 |
This used to be a quick hack which now seems to serve a useful purpose,
|
| 81 |
but can give bad results for functions which are not smooth.
|
81 |
but can give bad results for functions which are not smooth.
|
| 82 |
|
82 |
|
| 83 |
For expensive-to-compute \code{expr}essions, you should use smarter tools.
|
83 |
For expensive-to-compute \code{expr}essions, you should use smarter tools.
|
| 84 |
|
84 |
|
| 85 |
The way \code{curve} handles \code{expr} has caused confusion. It
|
85 |
The way \code{curve} handles \code{expr} has caused confusion. It
|
| 86 |
first looks to see if \code{expr} is a \link{name} (also known as a
|
86 |
first looks to see if \code{expr} is a \link{name} (also known as a
|
| 87 |
symbol), in which case it is taken to be the name of a function, and
|
87 |
symbol), in which case it is taken to be the name of a function, and
|
| 88 |
\code{expr} is replaced by a call to \code{expr} with a single
|
88 |
\code{expr} is replaced by a call to \code{expr} with a single
|
| 89 |
argument with name given by \code{xname}. Otherwise it checks that
|
89 |
argument with name given by \code{xname}. Otherwise it checks that
|
| Line 93... |
Line 93... |
| 93 |
is evaluated in an environment which supplies a vector of name given
|
93 |
is evaluated in an environment which supplies a vector of name given
|
| 94 |
by \code{xname} of length \code{n}, and should evaluate to an object
|
94 |
by \code{xname} of length \code{n}, and should evaluate to an object
|
| 95 |
of length \code{n}. Note that this means that \code{curve(x, ...)} is
|
95 |
of length \code{n}. Note that this means that \code{curve(x, ...)} is
|
| 96 |
taken as a request to plot a function named \code{x} (and it is used
|
96 |
taken as a request to plot a function named \code{x} (and it is used
|
| 97 |
as such in the \code{function} method for \code{plot}).
|
97 |
as such in the \code{function} method for \code{plot}).
|
| 98 |
|
98 |
|
| 99 |
As from \R 2.14.0 the \code{plot} method can be called directly as
|
99 |
As from \R 2.14.0 the \code{plot} method can be called directly as
|
| 100 |
\code{plot.function}.
|
100 |
\code{plot.function}.
|
| 101 |
}
|
101 |
}
|
| 102 |
|
102 |
|
| 103 |
\value{
|
103 |
\value{
|
| 104 |
A list with components \code{x} and \code{y} of the points that were
|
104 |
A list with components \code{x} and \code{y} of the points that were
|
| 105 |
drawn is returned invisibly.
|
105 |
drawn is returned invisibly.
|
| 106 |
}
|
106 |
}
|
| 107 |
|
107 |
|
| 108 |
\section{Warning}{
|
108 |
\section{Warning}{
|
| 109 |
For historical reasons, \code{add} is allowed as an argument to the
|
109 |
For historical reasons, \code{add} is allowed as an argument to the
|